Topic: relation of model origin to render position
Joined: 13 Jan 2008 Posts: 166
Posted: 06-27-2011 08:29 AM
I would appreciate if somebody could explain how the origin of an entity (i.e. the value of the vector 'origin' in 'entityState_t') and the position of the origin of the model relative to its bounding box determine the position where the model is actually rendered on the screen.
My problem is that I would like to spawn a model at the current position of the player (kind of a hologram replacement). I have created a model by joining the three parts of a player model (static mesh, no animation), it's origin in the MD3 file is set to the geometric center of the bounding box. I spawn it as a special item (I use my own spawn function for this) and copy the origin of the player entity to the origin of the new entity. Everything works OK, the hologram model is displayed, but it is floating over the ground by about half of the model's size. OTOH, the bounding box seems to be vertically offset from the visually displayed model, because if I shoot at the model only the lower part can be hit (including the volume which is between the bottom of the visible model and the ground).
I tried to add code to drop the model to the floor as normal items do, but it did not help. Any idea how to make the model appear standing on the floor exactly as the player was?