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
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
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
[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
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
[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.
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
[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
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