Sign in to follow this  
dhartles

Need help with 2D Map

Recommended Posts

OK, I'm new to Direct X (2 weeks), but I've made it through several books (Tom Miller's Kickstart), and .NET Game Programming with DirectX 9.0(Managed). I've decided to get my feet wet with a 2D engine(game) before making the leap to 3D. I've gotten to the point where I can generate a tile type map that is comprised of sprites (created by a class) that are stored into a 2 dimensional array. What I would like to know is can the camera angle (transform.view) be changed to represent more of a 45' perspective vs. the top-down view that is currently the default. My understaning from TM's book, is that the sprite objects in MDX are constructed the same way you would create a 'flat' 3D rectangle. If this is the case shouldn't I be able to rotate either the camera around the sprites that make up my map (or rotate the sprites themselves?). Thanks in advance. Dave

Share this post


Link to post
Share on other sites
I haven't read the book you mention, but from what you say I presume you're using the D3DX Sprite wrapper? (ID3DXSprite in C++, not sure what its called in the managed world)...

If I'm right on this assumption, changing any of the matricies should have no affect. They use "Transformed and Lit" geometry to effectively become 2D entities, thus they skip the transform pipeline and are never touched by your view matrix.

If you want the camera to pan around/zoom/whatever around sprites you'll probably have to do some work yourself - probably implementing your own form of sprite (or billboard) like rendering.

hth
Jack

Share this post


Link to post
Share on other sites
Thanks Jack. Yes, the Sprite object in MDX is the wrapper for the D3DX Sprite.

Your reply confirms my suspicions. I was having no luck apply a transform.view.

At least I know now not to spend anymore time on it. I'm going settle with the trad. 2D view for now until I get this game finished. Then I'll foray into 3D.

Thanks Again,
Dave

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you set the D3DXSPRITE_OBJECTSPACE flag in the Sprite->Begin function, you can perform transformations on your sprite

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this