Billboard Objects, again
A billboard object is something that always points towards the viewer. These are common in FlightGear but have no apparent equivalent in X-Plane. Here is my way of getting them to work.
This is the hierarchy in the AC3D source for the model. Anything hidden/locked does not get exported to the X-Plane .obj format model file.
Here is another version to show the seaparate animations. The left-hand palm tree is set for permanent view with the EXTernal animations. ( only sim/graphics/view/pilots_head_psi ) The right-hand palm tree is set for permanent view with the INTernal animations. ( sim/graphics/view/pilots_head_psi plus sim/flightmodel/position/mag_psi ) The central one switches automatically (same as the original version shown above).
Neither version works for all occasions. There may well be a neater way of doing this but I stopped working on it when it met the spec.
But in external view pilots_head_psi indicates the offset from north (-160 !!).
In both cases, we want the billboard to point at 200 minus 180 = 20 degrees so that it points at the viewer.
Carrying on . . . with the external view first, because it is the easiest: This animation inverts the viewpoint (pilots_head_psi)
ANIM_rotate 0.000000 1.000000 0.000000 90.000000 -90.000000 -90.000000 90.000000 sim/graphics/view/pilots_head_psi
so -160 becomes 020 deg and all is well. But it isn't going to work for the internal view. For much of the time pilots_head_psi will be zero, or close to that, so the billboard would mostly be facing south-ish.
For that we have:
ANIM_rotate 0.000000 1.000000 0.000000 90.000000 -90.000000 -90.000000 90.000000 sim/flightmodel/position/mag_psi
which inverts the aircraft heading, so 200 becomes 020 deg and the next animation
ANIM_rotate 0.000000 1.000000 0.000000 90.000000 -90.000000 -90.000000 90.000000 sim/graphics/view/pilots_head_psi
then applies a correction, depending on whether the pilot is looking left or right of the aircraft heading.
which inverts the aircraft heading, so 200 becomes 020 deg and the next animation
ANIM_rotate 0.000000 1.000000 0.000000 90.000000 -90.000000 -90.000000 90.000000 sim/graphics/view/pilots_head_psi
then applies a correction, depending on whether the pilot is looking left or right of the aircraft heading.
Example applications, include: rock formations, custom landing zones and for if you want to do a bit of a cheat with taxiway signs at an airport.
Comments
Post a Comment