• Advertisement
Sign in to follow this  

How to deign a gizmo like the gizmo in 3ds max

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

How to deign a gizmo like the gizmo in 3ds max? I want to design a gizmo for moving a 3d object in mapeditor.

Share this post


Link to post
Share on other sites
Advertisement
in max a gizmo is some kind of a helper object-a cube, sphere and another shape (it can be used to make a volume fog effect in that shape,...). I think he wants to make some kind of a dummy object to position stuff

Share this post


Link to post
Share on other sites
The 'Gizmo' is the tri-cursor tied to the centre of the currently selected object (mesh, face, vertex, whatever). Drag the mouse over one of its axis pointers to restrain movement/scale/rotation on that axis.

See the 3 arrows on the tip of the nose:



To make one, I'd start by grabbing the forward, right and up vectors of the currently selected object, normalising then, then drawing coloured lines from the centre to:

Position.Translate(ForwardVector.Normalised() * Length)

If the above makes sense. Sorry I'm no DirectX/XNA user. Next, add coloured triangles to the tip.

Share this post


Link to post
Share on other sites
It should be fairly straight forward to do.

Start off by creating yourself a model of the gizmo, just like any other mesh. The mesh should be built with the arrows aligned to the axis, and with its origin at (0,0,0) for ease of positioning it.

Then, when you select a mesh, draw that gizmo centered on the mesh's pivot point or on the center of the mesh itself (position it however you like).

Then, whenever you process mouse input into the scene, test against the gizmo mesh first, and if the user clicks on it, and starts dragging it, then move the mesh itself accordingly. There's a little bit of math involved with this, look for tutorials on mesh picking if you aren't familiar with how to do it.

Same type of deal goes for the rotation and scaling gizmos.

Share this post


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

  • Advertisement