Jump to content
  • Advertisement
Sign in to follow this  

Positioning a mesh statically while the camera moves over the terrain [DirectXC#]

This topic is 3772 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

Hi guys, I've been working hard on making an RTS game and I've managed so far to create splashscreens, UI for the main menu and play options, using a bitmap to create a terrain, a user controlled camera that uses the mouse and keyboard to look over the terrain and using a 3D model for a building. Now the problem is that I want to have buildings in fixed places on the map but always at the height of the map at the location (another words, not floating above the terrain and not beneath it). I've managed to draw the building but it gets drawn in the middle of the screen regardless of where the camera is facing rather than staying in place while the camera moves. The three main classes for this would be GameCamera which controls the position and target of the camera, Map which draws the map and Headquarters which implements IBuilding and is the building I want to be drawn at a static position. This pastebin shows all of these classes: http://pastebin.com/m77f1c023 After I have this and the UI sorted I will need a way of placing the buildings with the mouse, any advice on this would be greatly appreciated. Thank you!

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!