<div dir="ltr">Hi community,<div><br></div><div>this is sort of easy math question (btw, I missed that part in my classes ;-) ) I want to check it with you.</div><div><br></div><div>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)</div><div><br></div><div>Vec3 terrainNormal;</div><div><br></div><div>Quat terrainOrientation;</div><div>terrainOrientation.makeRotate(Vec3(0,0,1), terrainNormal);</div><div><br></div><div>Quat modelOrientation;</div><div>modelOrientation.makeRotate(Vec3(0,1,0), whatever);<br></div><div><br></div><div>Quat q;</div><div>q = terrainOrientation * modelOrientation; // not sure about this</div><div><br></div><div>MatrixTransform mxt = ...</div><div>mxt->setMatrix(Matrixd:;rotate(q) * ...);</div><div><br></div><div>Any hints?</div><div><br></div><div>Thanks a bunch as always!</div><div>Nick</div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">trajce nikolov nick<br></div>
</div></div>