Re: [osg-users] Improper rotation

2011-01-16 Thread Sergey Polischuk
Hi, Seems like i can't advice anything really usefull on 3ds max and modelling stuff, because i'm have never done any modelling, i'm just programmer. Though it can be that model is fine in modelling tool, and export settings apply optimizations that cause things go wrong. If you use 3ds max

Re: [osg-users] Improper rotation

2011-01-14 Thread Axel Spirtaat
Hi Sergey, really thanks for your help. hybr wrote: Hi, Basically what you need to do is translate rod to (0,0,0), apply rotation that u need, and translate back to original position. If your math is right and you still haven't expected results i'd say that your model has static

Re: [osg-users] Improper rotation

2011-01-13 Thread Axel Spirtaat
Hi Tom, thanks a lot for your answer! Tom Pearce wrote: In the step where you're calculating m, it looks like you're applying the rotation to the original matrix, which includes a translation already. Yes, this is (perhap) what i want. I try to be less ambiguous: my scene is a small

Re: [osg-users] Improper rotation

2011-01-13 Thread Sergey Polischuk
Hi, Basically what you need to do is translate rod to (0,0,0), apply rotation that u need, and translate back to original position. If your math is right and you still haven't expected results i'd say that your model has static transforms removed and translated to vertices coords, so center of

[osg-users] Improper rotation

2011-01-12 Thread Axel Spirtaat
Hi, i'm trying to rotate a rod (part of a 3rd party model) on its Y asxis. I read on OSG Startguide that to do it, i need to find the correct position of my object from the origin and apply a multiplication like T * M * -T. The source code that tries to do it is the follow Code: ing:

Re: [osg-users] Improper rotation

2011-01-12 Thread Axel Spirtaat
I understood part of the issue, and thus I corrected (part of) the error. Now seems that the rotation and the translation is formally right, but visually translation is wrong. I enclosed 3 pics of the scene, before rotating, after 1st rotation and after 2nd rotation. I correct the source as

Re: [osg-users] Improper rotation

2011-01-12 Thread Tom Pearce
Hi Axel, In the step where you're calculating m, it looks like you're applying the rotation to the original matrix, which includes a translation already. Code: osg::Matrix m = amtRod-getMatrix() * osg::Matrix::rotate(rotation, osg::Vec3(0,1,0)); It sounds like what you want to do is rotate