Rotation

Technical discussions
Post Reply
NigelR
Posts: 3
Joined: Fri Aug 09, 2013 9:34 am

Rotation

Post by NigelR »

Hello
I am trying to implement spinning of an object to continuously spin it for demo purpose
I noticed how fast the object redraws when I'm using the mouse to rotate it
However when I programmatically spin the model it's performance is noticeably reduced. Is there better way to do the rotation then getting an IFrame,
calling RotateStd, followed by an updateview() call.
If there is a feature that leverages the functionality of the mouse interactions I did notice while spinning the model with the mouse changing surface temperatures/colors is ignored until the mouse button is released. My second approach would be to try the eMotion example; however, the example is pretty overwhelming and I'm having problems following the code. I'm trying to do a simple one axis rotation/animation, do you have some simplified code or is it better to stick with the rotateStd fired from a timer?
I would appreciate any insights
Nigel

nickz
Site Admin
Posts: 206
Joined: Fri Jul 26, 2013 3:58 am

Re: Rotation

Post by nickz »

Hi Nigel
It is important to clarify whether you really need to move objects around in 3D, one relative to another (=object relative to the global frame) or you just need to look at the model from different (moving) point of view. The later is animation of view. It is faster. This is what happens when you do the normal view manipulation with the mouse.

In sample explorer View > Rotation sample has Animate button, which animates viewing rotation. I think there is only C++ version unfortunately, but everything should be clear. It uses IFrame.Rotate(angle, axis) to rotate scene on timer event. IFrame here is the eye frame. Details: http://www.dynoinsight.com/Help/VC/Rotation.aspx

Animating the actual movement of object is done nearly same way but the IFrame is the local frame of the object. It is slower, but not much. It can be slow if the object has lots if children objects attached.

The simplest sample for this is Collision: http://www.dynoinsight.com/Help/Samples ... ision.aspx . The animation happens on Move button.
It is also possible is that your timer period for animation is too short. Generally animation needs a bit of tuning in to get it working right. Try starting with very long period like 100. It will be jerky. Reduce it with watching how the behaviour changing until you get it smooth.

Regards
Nick

NigelR
Posts: 3
Joined: Fri Aug 09, 2013 9:34 am

Re: Rotation

Post by NigelR »

Thanks, Nick
This makes lots of sense
Nigel

Post Reply