Jump to content

ModelView matrix


photo

Recommended Posts

Posted

I noticed the Player object has a modelview matrix.

 

The use of this modelview matrix confuses me a little.

 

Normally a modelview matrix is a combination of model matrix and view matrix.

The modelmatrix is used to convert from object space to world space.

The view matrix is used to convert from world space to eye space.

 

This would mean that the modelview matrix need to be set for each object seperately.

But it is set only once for each rendering.

And it seems to be set to the inverse of the wordtransform.

 

Therefore I wonder if the modelview in Unigine is only used as the view matrix.

Is this correct or am I missing something here?

Posted

The modelview matrix is set to the player. To put it plainly, it is as if it was looking at the world from the center of coordinates and all transformations of objects are calculated accordingly. That is why you only need to set it once.

Yes, in most cases the modelview matrix is the inverse of the wordtransform. For example, It goes for PlayerSpectator and PlayerPersecutor. However, it does not apply for PlayerActor because its transformation and viewing orientation differ from each other.

×
×
  • Create New...