Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2007-01-16 Thread Alberto Luaces
Hi, El Lunes, 15 de Enero de 2007 23:59, Steve Schneider escribió: > >osg::Quat rotate; > >rotate.makeRotate(terrainNormal, osg::Vec3f(0,0,1)); voidmakeRotate (const Vec3d &vec1, const Vec3d &vec2) "Make a rotation Quat which will rotate vec1 to vec2. " In other words: you create a quaterni

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2007-01-15 Thread Steve Schneider
I know it's been a long time (since Jul 25, 2006), but could you - or maybe anyone else - please paste the code to have the tank follow the terrain in an email? Like a reply to this one? The code paste link doesn't produce any code that I could find. DriveManipulator.ccp might be a good

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-25 Thread gbetti
Hi Ulrich and others. I managed to set up tank rotation according to terrain , but tank is rotating wrong ( opposite ) to direction vector. So it basically lift up front side while travelling forward. .. terrainHeight = heightTestResults.getWorldIntersectPoint(); terrainNormal = heightTest

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-23 Thread Ulrich Hertlein
[EMAIL PROTECTED] wrote: terrainNormal = heightTestResults.getWorldIntersectNormal(); angle = terrainNormal.y(); tankXform->setAttitude(osg::Quat(osg::DegreesToRadians(angle), osg::Vec3(0,0,1) ) ); Maybe someone spots an error ? It's unusual to use the y component of the no

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-22 Thread gbetti
Ok, I did that allready in class updateTankPosCallback : public osg::NodeCallback but it didn't work using: terrainNormal = heightTestResults.getWorldIntersectNormal(); angle = terrainNormal.y(); tankXform->setAttitude(osg::Quat(osg::DegreesToRadians(angle), osg::V

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-21 Thread Ulrich Hertlein
[EMAIL PROTECTED] wrote: Thanks Ulrich, that helps. My problem now is how to find the terrain normal , any hint ? That depends greatly on the way your terrain is stored. If you have a mesh/geometry you could use the IntersectVisitor and shoot straight down from your current position.

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-21 Thread gbetti
Thanks Ulrich, that helps. My problem now is how to find the terrain normal , any hint ? Thanks, Gab > > > [EMAIL PROTECTED] wrote: > > I am trying to have the tank following terrain in a simple application > > following tutorial on NPS site. > > The problem I have is that while tank move

Re: [osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-21 Thread Ulrich Hertlein
[EMAIL PROTECTED] wrote: I am trying to have the tank following terrain in a simple application following tutorial on NPS site. The problem I have is that while tank moves with right height from terrain trough an intersectVisitor I can't get it to follow terrain ondulation ( setAttitude ).. Is th

[osg-users] can't set tank rotation to world normals ( follow terrain )..

2006-07-20 Thread gbetti
Hello, I am trying to have the tank following terrain in a simple application following tutorial on NPS site. The problem I have is that while tank moves with right height from terrain trough an intersectVisitor I can't get it to follow terrain ondulation ( setAttitude ).. Is there a wa