[Flightgear-devel] Getting the right View position and orientation

2005-01-25 Thread Luca Masera
Hi Jim,

It may help for you to explain more about what you are trying to do.  Is this
exhaust smoke from a moving aircraft model?  Probably I'm the one to help you
since I rewrote most of the viewer a couple years ago,  but I just don't
understand what you are asking.

This is may not help, since I am guessing about what you are trying to do, but
take a look at the code in SimGear/scene/model to see how to place an ssg
object (ssgBranch) in the scene.  This can be used for both stationary and
moving objects.

I'm trying to add the smoke like the one of the acrobatic aircrafts (for 
example, the
Frecce Tricolori). To do that I've used a modified version of the 
ssgaParticleSystem.
I'm able to correctly place the objects - they appear inside the aircraft - 
and their 
position doesn't change when the aircraft moves (in the first attempt, I've add 
the
particle system to the aircraft node into the nodegraph of PLIB, but this 
doesn't work
right). Instead, I've add a function that moves randmly the particles into the 
3D
space.
My main problem is that the particles doesn't rotate to follow the point of 
view of
the user so they are visible only when their normal points to the user. I've 
watched
the code that rotates the particles into the ssgaParticleSystem.cxx file and 
I've found
that the tecnique used rotates the objects using the data stored into the
GL_MODELVIEW matrix. I've printed it on the screen and, in FlightGear this 
matrix
is always the identity matrix: I've found the problem, but I'm not able to find 
a
solution. I've watched the code of the billboard animation, the viewer manager 
and
the viewer files, but I'n not able to get the rotation and the position of the 
point of 
view into the space. If I could get this data, I'll able to create a matrix 
like the
GL_MODELVIEW and use it to rotate the objects.


Thanks, Luca





Navighi a 2 MEGA e i primi 3 mesi sono GRATIS. 
Scegli Libero Adsl Flat senza limiti su http://www.libero.it



___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Getting the right View position and orientation

2005-01-21 Thread Luca Masera
Hi everyone,

I've added a particle system to FlightGear that simulates the smoke via a PLIB 
object
(I adapted the class ssgaParticleSystem to meet some requirements).
However, I've in trouble with billboarding. Used alone, with a PLIB's example, 
the code
that rotates the particles following the user movement's works right. In 
FlightGear,
instead, that code doesn't works and the particles follows the user only within 
a small
range of rotations (they move like the lens flare...).

I think that the bug is into the code of rotation: it uses the MODELVIEW 
matrix, that
maybe doesn't works with the lookAt and lookFrom.

There's a way to get the position and the rotation of the view (I've tried 
about all the 
methods into the class FGViewer, but even when the view is rotated the data 
doesn't
change). If I could get them maybe I'll able to correctly rotate the particles.

Hi,

Luca




6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
Scaricalo su INTERNET GRATIS 6X http://www.libero.it



___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Getting the right View position and orientation

2005-01-21 Thread Jim Wilson
Luca Masera said:

 Hi everyone,
 
 I've added a particle system to FlightGear that simulates the smoke via a
PLIB object 
 (I adapted the class ssgaParticleSystem to meet some requirements). 
 However, I've in trouble with billboarding. Used alone, with a PLIB's
example, the code 
 that rotates the particles following the user movement's works right. In
FlightGear, 
 instead, that code doesn't works and the particles follows the user only
within a small 
 range of rotations (they move like the lens flare...).
 
 I think that the bug is into the code of rotation: it uses the MODELVIEW
matrix, that 
 maybe doesn't works with the lookAt and lookFrom. 
 
 There's a way to get the position and the rotation of the view (I've tried
about all the 
 methods into the class FGViewer, but even when the view is rotated the data
doesn't 
 change). If I could get them maybe I'll able to correctly rotate the 
 particles.
 

Hi Luca,

It may help for you to explain more about what you are trying to do.  Is this
exhaust smoke from a moving aircraft model?  Probably I'm the one to help you
since I rewrote most of the viewer a couple years ago,  but I just don't
understand what you are asking.

This is may not help, since I am guessing about what you are trying to do, but
take a look at the code in SimGear/scene/model to see how to place an ssg
object (ssgBranch) in the scene.  This can be used for both stationary and
moving objects.

Is there anyone on the list who can translate to and from italian?  Maybe that
would help.

Best,

Jim


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d