Jump to content
  • Advertisement
Sign in to follow this  
G-Man9566

Create a Transfrom Gizmo

This topic is 3966 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, I am using D3D9. I want to create a transform gizmo to move, rotate and scale my objects, like the ones you get in 3dsmax etc. What would I typically use for it? Should I use ID3DXLine? The idea dor the gizmo is something like this....

Share this post


Link to post
Share on other sites
Advertisement

Hi,

I don't see any problem with drawing such a thing on the screen using lines and triangle mesh for the cones + some text.

Of course, you'll want your gizmo to be visible even if it is behind / inside an object - so you may need to turn of z-comparison/writes.

Implementing the functionality is another thing. You'd need a kind of a grip object which would react to the cursor movement. For example if the user clicks on the z axis, then the grip object would instruct to move the object by z-axis according to the mouse movement. Practically, to implement this, you'll need to do some ray-object intersection test to know which part of the gizmo is being clicked on in order to find the right function.

Good luck!

Share this post


Link to post
Share on other sites
Thnks kauna.

Quote:
Of course, you'll want your gizmo to be visible even if it is behind / inside an object - so you may need to turn of z-comparison/writes.


I assume that one can just turn off z-comparison writes for the specific gizmo(or lines) that on renders. Would this be the same as Z-Buffer testing?

I also assume that it is possible then to test ray intersection with a ID3DXLine?

Share this post


Link to post
Share on other sites
The rendering of the gizmo and the way you handle mouse and transformation can be completely seperated. You can have 2 different classes, one for rendering, one for handling mouse, movement, etc. Or you can have 1 class doing both.
So for rendering, use the method you feel the most comfortable with, be it DrawPrimitive or ID3DXLine.
For example, in my editor, my manipulators classes inherit from my Mesh class, and I just load a static Mesh from a file. In my case this has the advantage to enable ray casting on the manipulators, to detect which axis is being clicked. And since the Mesh class provides everything for rendering, it's already included in the engine without more work (except adding a few renderstates :)

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!