Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 May 2012
Offline Last Active Jun 29 2015 08:53 AM

Topics I've Started

Learning Direct3D Programming properly

26 June 2015 - 12:43 AM

Hi GameDev community, it's been a while!
I've been doing hobby game programming for a few years now, but I feel like considering how long I've been doing it for, I am nowhere near as fluent with it as I should be.
I learned all that I know about DirectX 9 programming from www.directxtutorial.com and while I feel that was a decent start, I feel like I've missed learning a lot of things that is therefore limiting my ability to program.
I've been able to make basic games in the past with not much of an issue, but now I decided to take on my biggest personal project so far, which is nothing huge, just a Doom-style FPS, and I'm quickly finding that I'm on the internet looking for help on things that I feel I should already know how to do.
That said, I'm wondering if anyone here can point me to a good resource (website/book/anything) on learning to program in DirectX properly.
I had a look through the documentation that ships with the DXSDK but it doesn't make a lot of sense to me. 
I need something that will start with the basics again, and not only tell me what to do but explain /why/ it works that way so that I can retain the information without it just being a bunch of jargon.
I'm still using Direct3D 9 functions, I've been meaning to learn Direct3D 11 functions but looking over it briefly it seems a lot more complex and I've been putting it off because of that.
So my questions are as follows:
-Do I need to learn to use 9 effectively before migrating to 11?
-What is a good resource to start learning to program in DirectX effectively and know what I'm actually doing?
Thanks in advance.

Locking a D3DXMesh's vertex buffer

27 July 2013 - 06:43 PM

Hey GameDev


I'm trying to lock an LPD3DXMESH's vertex buffer so as I can fiddle with the vertices.

My problem is that as follows:


When you manually create a mesh in code, you have your own CUSTOMVERTEX kind of struct, and then when you lock the vertex buffer, you can hand it a void pointer to your CUSTOMVERTEX type. EG

	vb->Lock(0, 0, (void**)&vert, NULL);

But when I need to lock the meshs vertex buffer, I don't have a vertex class to lock it with.


So my question is, how do I lock the mesh vertex buffer when I don't have a vertex struct? Is there a kind of default vertex stuct I can use?

Terrain Collision and Bounding spheres?u

25 July 2013 - 02:30 AM

Hey Gamedev 


I will shortly be making up some terrain for my game. How I do this, I'm yet to decide between a static mesh, or a heightmap.


I have 2 questions;


First of all, what is the best/the simplest/easiest/whatever gets the job done/ way to detect collision between the character, and the terrain. I don't want the player "snapped" onto the terrain, so I don't want him to glide up massive slopes. How would I go about doing this? Detecting the collision and offsetting the characters y position accordingly?


My second question is, I constantly hear people using bounding spheres for player collision. Why is this? It seems to me that a bounding box or cylinder would be more accurate (unless the player was a fatty) why use a sphere?

First Person Rolling problem

24 July 2013 - 06:57 AM

Hey GameDev :)


My first person camera is rolling when I move the mouse in circles. I don't know what's wrong with it, please help me.

	void Pitch(float angle)
		D3DXMatrixRotationAxis(&T, &right, angle);

		D3DXVec3TransformCoord(&up, &up, &T);
		D3DXVec3TransformCoord(&lookDirection, &lookDirection, &T);
	void Yaw(float angle)
		D3DXMatrixRotationAxis(&T, &up, angle);

		D3DXVec3TransformCoord(&lookDirection, &lookDirection, &T);
		D3DXVec3TransformCoord(&right, &right, &T);

Help rotating a sprite D3D9

29 March 2013 - 07:16 AM

Hey GameDev


I've 2 sprites, an enemy and a guy, and I'm trying to rotate guy, but not enemy:


void Draw(LPD3DXSPRITE sprite, LPDIRECT3DDEVICE9 d3dDevice)
	sprite->Draw(texture, &enemy, &D3DXVECTOR3(0, 0, 0), &D3DXVECTOR3(400, 400, 0),                D3DCOLOR_ARGB(255,255,255,255));
	sprite->Draw(texture, &guy, &D3DXVECTOR3(0, 0, 0), &guyPosition, D3DCOLOR_ARGB(255,255,255,255));



Problem is it rotates both of them, and I don't know why. Help?