<div dir="ltr">Hi Sebastian,<div><br></div><div>the code will be welcome. I was expecting that the proper way is to go through Eulers</div><div><br></div><div>Thanks a lot!</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 1, 2017 at 9:48 AM, Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Trajce,<br>
<br>
Did I miss the question :-) If it is working: fine. :-)<br>
<br>
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.<br>
<br>
Cheers<br>
Sebastian<br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi community,<br>
<br>
this is sort of easy math question (btw, I missed that part in my<br>
classes ;-) ) I want to check it with you.<br>
<br>
It is about node following terrain. my node is MatrixTransform and I<br>
have to set it in world coordinates. The node has it's own rotation and<br>
I just need to take the terrain normal into account. Here is the<br>
pseudocode that produces some acceptable results (not sure if they are<br>
correct though, thus asking you for hints)<br>
<br>
Vec3 terrainNormal;<br>
<br>
Quat terrainOrientation;<br>
terrainOrientation.makeRotate(<wbr>Vec3(0,0,1), terrainNormal);<br>
<br>
Quat modelOrientation;<br>
modelOrientation.makeRotate(Ve<wbr>c3(0,1,0), whatever);<br>
<br>
Quat q;<br>
q = terrainOrientation * modelOrientation; // not sure about this<br>
<br>
MatrixTransform mxt = ...<br>
mxt->setMatrix(Matrixd:;rotate<wbr>(q) * ...);<br>
<br>
Any hints?<br>
<br>
Thanks a bunch as always!<br>
Nick<br>
<br>
<br>
--<br>
trajce nikolov nick<br>
<br>
<br></div></div>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>