Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Fri Jul 30, 2010 10:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: TextureMatrix
PostPosted: Mon Jun 20, 2005 11:19 pm 
Offline
missed 400 shots

Joined: Thu Dec 30, 2004 11:38 pm
Posts: 454
Location: Minnesota US
i am trying to understand idMapBrushSide in an effort to analyze .map files... :roll:

what is a TextureMatrix?

in idMapBrushSide:

Code:
class idMapBrushSide {
   friend class idMapBrush;

public:

   const char *         GetMaterial( void ) const { return material; }
   void               SetMaterial( const char *p ) { material = p; }
   const idPlane &         GetPlane( void ) const { return plane; }
   void               SetPlane( const idPlane &p ) { plane = p; }
   void               SetTextureMatrix( const idVec3 mat[2] ) { texMat[0] = mat[0]; texMat[1] = mat[1]; }
   void               GetTextureMatrix( idVec3 &mat1, idVec3 &mat2 ) { mat1 = texMat[0]; mat2 = texMat[1]; }
   void               GetTextureVectors( idVec4 v[2] ) const;


protected:
   idStr               material;
   idPlane               plane;
   idVec3               texMat[2];
   idVec3               origin;
};



I have looked at how it is stored:

Code:
brushDef3
{
  ( 0 0 -1 0 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
  ( 0 0 1 -8 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
  ( 0 -1 0 -32 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
  ( 1 0 0 -40 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
  ( 0 1 0 -32 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
  ( -1 0 0 -16 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_floor/a_diafloor_1b_fin" 0 0 0
}


and i understand how it is parsed. but i don't get what it represents?

the only thing i can find is:

Code:
   // read the texture matrix
   // this is odd, because the texmat is 2D relative to default planar texture axis

      if ( !src.Parse2DMatrix( 2, 3, side->texMat[0].ToFloatPtr() ) ) {
         src.Error( "idMapBrush::Parse: unable to read brush side texture matrix" );
         sides.DeleteContents( true );
         return NULL;
      }


thanks for any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:06 pm 
Offline
Plasma Spammer
User avatar

Joined: Fri Jun 27, 2003 11:24 pm
Posts: 2709
Location: Munich, Germany
It's a 2x2 matrix that the UV coordinates of the brush are transformed with. So it controls the rotation and scale of the texture on that brush side.

_________________
Image Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:45 pm 
Offline
missed 400 shots

Joined: Thu Dec 30, 2004 11:38 pm
Posts: 454
Location: Minnesota US
i see :wink:

thanks der_ton.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 5:46 pm 
Offline
picked up the chaingun

Joined: Tue Nov 02, 2004 3:03 am
Posts: 175
Location: Mesquite, TX
it's actually a 3 x 2 matrix.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 6:27 am 
Offline
picked up 100 armour

Joined: Fri Aug 19, 2005 7:17 am
Posts: 143
Location: Missouri
Would it be possible to store more than one set of UV Coordinates on a brush and then specify which coordinates you want to use for mapping a texture in a shader file?

Example use: Applying a material to a brush that blends two textures where each texture is mapped with different coordinates.

_________________
- pha3z


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Oneofthe8devilz and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group