I am trying to display a cone in front of the pilot. I am using CylinderGraphics which works great but the cone is displayed around the pilot and oriented downwards. Is it possible to:
Change the attachment point of the cone so that the pilot is at its tip and not in the middle?
Rotate the cone 90 degrees? I’m using VelocityOrientationProperty for the orientation of the entity.
This is an example of how it currently looks at XCvid:
By default, the center of a CylinderGraphics will be the origin. When you want to use the top of a cylinder (or the “tip” of a cone, in your example) as some sort of a “reference point”, then you have to take this into account when computing the rotation- and translation matrices.
Assuming that you have a rotationMatrix for the orientation and a translationMatrix for the desired position, you can compute
a toOriginMatrix to move the center of the coordinate system to the top of the cylinder
a fromOriginMatrix to move the center of the coordinate system back
The final modelMatrix for the cylinder can then be computed like this: