[osg-users] combining Quats
Trajce Nikolov NICK
trajce.nikolov.nick at gmail.com
Wed Feb 1 02:27:04 PST 2017
Hi Sebastian,
the code will be welcome. I was expecting that the proper way is to go
through Eulers
Thanks a lot!
On Wed, Feb 1, 2017 at 9:48 AM, Sebastian Messerschmidt <
sebastian.messerschmidt at gmx.de> wrote:
> Hi Trajce,
>
> Did I miss the question :-) If it is working: fine. :-)
>
> In general you are extracting the heading I guess (with the
> modelOrientation) and put it on top the tilted normal, which will put you
> on in this pose. The problem might be, that you introduce unwanted roll
> with this. I can give you some code (not based on OSG, but you'll get the
> idea) adapting a EulerAngle pose to a terrain normal using a local tangent
> plane.
>
> Cheers
> Sebastian
>
>
>
>
> Hi community,
>>
>> this is sort of easy math question (btw, I missed that part in my
>> classes ;-) ) I want to check it with you.
>>
>> It is about node following terrain. my node is MatrixTransform and I
>> have to set it in world coordinates. The node has it's own rotation and
>> I just need to take the terrain normal into account. Here is the
>> pseudocode that produces some acceptable results (not sure if they are
>> correct though, thus asking you for hints)
>>
>> Vec3 terrainNormal;
>>
>> Quat terrainOrientation;
>> terrainOrientation.makeRotate(Vec3(0,0,1), terrainNormal);
>>
>> Quat modelOrientation;
>> modelOrientation.makeRotate(Vec3(0,1,0), whatever);
>>
>> Quat q;
>> q = terrainOrientation * modelOrientation; // not sure about this
>>
>> MatrixTransform mxt = ...
>> mxt->setMatrix(Matrixd:;rotate(q) * ...);
>>
>> Any hints?
>>
>> Thanks a bunch as always!
>> Nick
>>
>>
>> --
>> trajce nikolov nick
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170201/60a44cfd/attachment-0003.htm>
More information about the osg-users
mailing list