Jump to content
  • Advertisement
Sign in to follow this  
fguihen

[.net] allowing user to dynamically create objects

This topic is 5409 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. im doing a crowd simulation program. i want the uer to ba able to , before they set the simulation in motion , create a simple envrionment. all it will be is allowing them to create a series of obstacles or walls in the window. theese walls and obstacles will only be 3d rectangles, nothing fancy like everyday objects. i dont know how to allow the user to just by using the mouse, drag out the size of the required obstacle, rather than have to hard code in specific envrionments. i want to do it in the same way you drag out the size of a rectangle you want in paint, except i will be doing it in 3d. im using managed directX and c#. i have little, to no expirience with direct3D. hope you can understand my query. thanks all

Share this post


Link to post
Share on other sites
Advertisement
There are many ways to do what you ask. My first-gues approach would be:

1) hook up event handler for mouse movement & buttons
2) Create a system to tie the input to a specific surface - a particular wall or floor tile
3) handle the button down, mouse move, and button up events the same way as in paint, by recording the screen coords.
4) After button-up, translate the screen coords to world coordinates using the tied surface to project onto.
5) Create the geometry based on the translated world coordinates.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!