Quake3World.com Forums
     Programming Discussion
        relation of model origin to render position


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: relation of model origin to render position

Veteran
Veteran
Joined: 13 Jan 2008
Posts: 167
PostPosted: 06-27-2011 08:29 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hi,

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?

Thanks!




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.