• Advertisement
Sign in to follow this  

Selective culling? (Duplicating the 3dmax gizmo)

This topic is 4683 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'm trying to duplicate the 3dmax rotation gizmo and I'm having trouble with the rotation axes. Effectively the selected object is surrounded by a fully transparent sphere upon which the x,y and z axes are highlighted. One can only see the outline of this sphere and the axes appear as semi-circles as if cut in half by an invisible plane perpendicular to the viewer passing through the center of the sphere. How can one achieve this (the semi-circle axes)? Many Thanks [Edited by - algorhythmic on April 26, 2005 6:15:23 PM]

Share this post


Link to post
Share on other sites
Advertisement
I can't recall offhand what 3DS Max looks like, but I think I have an idea. Could you post a screen shot of what you're looking for? Also, do you want this "half-circle" to be a half-circle in the positive plane of that axis at all times no matter what view, or do you want this look to always follow the viewer?

I don't understand the topic name of culling linestrips, but if that was an idea you had, I wouldn't recommend it. You could create half-cylinders to do the trick you're looking for, then just simply translate them to the origin of the model, and scale them in the direction of the axis. Or I could be totally misunderstanding. :)

Share this post


Link to post
Share on other sites
Yes you're quite right I tried to post a picture but my laptop's playing up. So after finally managing to kick my girlfriend off hers for a minute here you go. This should clarify things. What I'm trying to do is duplicate the coloured axes pointing towards the viewer. I could simply make them fun circles but I'd rather my gizmo looked like the 3dmax one:

Share this post


Link to post
Share on other sites
I suspect 3DS Max is simply drawing semicircles rather than anything complex like drawing a full circle and clipping it. If the vertices of the lines are untransformed then your world transformation matrix will cause cause the semicircles to rotate too.


If you really did want to clip a full circle into a semicircle and you're using the fixed function pipeline, then you _could_ use user clip planes to set arbitrary planes to clip against, see IDirect3DDevice9::SetClipPlane() for more information.


Personally though I'd just render a semi-circle rather than a full circle (much simpler, much more efficient and would produce exactly the same effect)...

Share this post


Link to post
Share on other sites
Just chek to see if the Normal of the line segment of your circle is negative (See Backface Culling)

Generate the normal as a ray from the center of your sphere to the line segment.

if the Normal DOT viewer is negative then it's facing away from you and you don't draw it.

Share this post


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

  • Advertisement