Sign in to follow this  
staticVoid2

a few questions about .x files

Recommended Posts

staticVoid2    381
can anyone tell me why the V unit of the texture coordinates in the MeshTextureCoords template is negative, and are vertices in Mesh stored as unit vectors and then scaled or are they stored as just vectors, because i've saw examples that say a cube of any size would be stored using only 1, -1 for each vertice and then scaled but when i've looked at a few .x files the vectors go beyond 1, -1 ?

Share this post


Link to post
Share on other sites
ankhd    2304
Hi, I think it depends if the object was created with local coord or world coord
local is good and easy but you will need to apply transforms to position and scale it in your 3d world.
hope that helps.
for .X file I think there are in object space.

Share this post


Link to post
Share on other sites
staticVoid2    381
thanks, I've tested different values and I don't think they are unit vectors, for a cube, all thats needed is the values 1 and -1, but you could make it 2, -2 or 0.5, -0.5 as long as the absolute value is the same, any ideas as to why the V coordinate is always negative though?

Share this post


Link to post
Share on other sites
littlekid    229
The 3D vectors that are stored in the .x file for the PositionCoord are position vectors. Meaning, they just represent a point in 3D space.

It not really meaningfull to have a normalize position vector or having things like unit position. Normalization/Unit Vectors only applies to direction vector. Where the 3Dvector in question represent a direction in 3D space and not a position/point.

It does not matter what the values of the coords are, as long in relative to each other, they represent the actual geometry.

For example it does not matter if the cube is 10x10x10 or 3x3x3, at the rendering loop, to draw the mesh, you would specifiy how much scale/rotation/translation you want and you will still get the same final result

cube 10x10x10 -> scale by 0.1 == 1x1x1
cube 3x3x3 -> scale by 0.3 == 1x1x1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this