Jump to content
  • Advertisement
Sign in to follow this  
dhartles

Need help with 2D Map in Managed Direct X

This topic is 5046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Have not tried it but sounds fair, might have to give it a go this weekend.

If so you should just change the cameras view point to change the way it looks.

Share this post


Link to post
Share on other sites
The simple answer is yes, you can. At it's most basic, you simply use the view/transform matrices to change your view of the map.

HOWEVER... If you have a pretty large map, you will want to only draw what the user can currently see on the screen, otherwise the game will run much slower than if you draw the portions of the map that are off the screen. (this is true regardless of the map perspective). It's very easy to figure out which portions of the map need to be drawn when the user is looking straight down at it, but it's more difficult when you use a different perspective, and much more difficult if you let the user dynamically change the perspective. You may want to look into BSP Trees and Viewing Frustrums.

Also, perspective can of course also be achieve by simply using artwork already created to look like it is in the proper perspective.

- Fuzz

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!