The following job is doable but requires a lot of effort. I was wondering if Panda3D has some features that could make this all simpler. I am somewhat new to Panda3D but am willing to bet that it has some features that will make this all so easy. So … I thought I would write this up and post it to see if I got any takers … peeps that could shed some light on these P3D features if they exist.
I am tasked with animating a rocket and its plume as the rocket flies out in 3D space. The plume must be attached to the rocket motor exhaust and oriented like the rocket and it must be scaled according to the instantaneous rocket motor thrust (see following figure … large thrust=>long plume, small thrust=>short plume).
Now, in order to achieve my objectives I will have to do the following:
- Get a quaternion describing the orientation of the missile at time=t and convert it to a direction vector.
- Get a vector describing the position of the missile at time=t
- Determine the length of the missile, divide it by two to get the half distance (model is centered), multiply the half-distance by the direction vector to get a plume translation vector that will place it at the rocket motor nozzle. 4) Adjust the plume translation vector according to the current plume scale.
- Orient the plume according to the missile and draw the plume.
I have modeled the rocket in LW9 and converted it to egg format (see figure below).
I modeled the plume as two orthogonal planes with a transparent texture mapped onto them (see figure below).
Now, in order to achieve my objectives I will have to do the following:
- Get a quaternion describing the orientation of the missile at time=t and convert it to a direction vector.
- Get a vector describing the position of the missile at time=t
- Determine the length of the missile, divide it by two to get the half distance (model is centered), multiply the half-distance by the direction vector to get a translation vector for the plume.
- Adjust the plume translation vector according to the current plume scale.
- Orient the plume according to the missile and draw the plume.
This seems like a lot of work but again it is doable. Anyone want to offer some advice on how to make this a little simpler?
Thanks,
Paul