Sign in to follow this  
akira32

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

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this