comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rotation of an IDLgrPolygon about a user specified axis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Rotation of an IDLgrPolygon about a user specified axis [message #36756] Fri, 17 October 2003 08:44
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"Beat Schmutz" <Beat.Schmutz@flinders.edu.au> wrote in message
news:f40e34db.0310162138.2297ce29@posting.google.com...
> Dear all,
>
> If have generated an IDLgrPolygon model (200000+ vertices) of a bone.
> I have centred the data so that the model is displayed in the centre
> of the view/window. What I would like to do now is to rotate the model
> about the long axis of the bone. This axis passes roughly through the
> centre of the bone's shaft and will not lay in the middle of any of
> the xyz data ranges, otherwise I could just do
> oModel -> ROTATE. Once I have determined the equation of this axis
> (utilising data coordinates returned by 'pickData' in the draw_Event
> handler) how can I then rotate the model around this axis?

You need to translate the model so that the point you are rotating around is
at the origin, perform the rotation, and then translate it back.

For example, if I have a square with opposite corner coordinates: [30,30,0],
[50,50,0]

And I want to rotate the square about the Z axis at a point passing through
the middle of the square, then

oModel->Translate, -40, -40, 0
oModel->Rotate, [0,0,1], angle
oModel->Translate, 40, 40, 0

Karl
[Message index]
 
Read Message
Previous Topic: Re: OS X 10.3 and IDL?
Next Topic: Re: xroi window too large

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 05:38:00 PDT 2025

Total time taken to generate the page: 0.40081 seconds