Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKurtO

Posted 13 February 2013 - 02:54 AM

I know blender is using the right-handed and DirectX is using Left handed coordinate system.

Of course this is creating some problem with my export.

 

But my problem isn´t logical.

 

I have made the simplest model in Blender and then export vertex-list x,y,z and normal x,y,z and u,v for texture mappings.

 

 

If i import my model with x = x, y = y, z = z from blender to DirectX in both vertex and normals my model is drawned like this:

 

It is 90 degrees tilted (this is understandable and logic), BUT also the model is "mirrored" in X-axis.

I can fix the Title by changing x with z when importing. but my normals is always wrong then and i cant fix it.

 

my code looks like this.

 

model = my directX model that has vertex Vector3 and normaol Vector3 and u,v float for mapping.

import = values from my export script from blender.

 

//When i just import the model i use this:

 

model.vertex.x = import.vertex.x;

model.vertex.y = import.vertex.y;

model.vertex.z = import.vertex.z;

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

model.normal.x = import.normal.x;

model.normal.y = import.normal.y;

model.normal.z = import.normal.z;

 

this is just 1->1 import and gives me titled result with mirrored x-axis.

 

I have tried this, but it wont work, the model is right but my normals and uv-mapping is wrong...

 

 

model.vertex.x = -import.vertex.x;

model.vertex.y = import.vertex.z;

model.vertex.z = -import.vertex.y;

 

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

//No mather what i set my normals to it is still wrong normals...

model.normal.x = -import.normal.x;

model.normal.y = import.normal.z;

model.normal.z = i-mport.normal.y;

 

 

How should my import routine look like for my vertex and normals plus uv?


#3KurtO

Posted 13 February 2013 - 02:53 AM

I know blender is using the right-handed and DirectX is using Left handed coordinate system.

Of course this is creating some problem with my export.

 

But my problem isn´t logical.

 

I have made the simplest model in Blender and then export vertex-list x,y,z and normal x,y,z and u,v for texture mappings.

 

 

If i import my model with x = x, y = y, z = z from blender to DirectX in both vertex and normals my model is drawned like this:

 

It is 90 degrees tilted (this is understandable and logic), BUT also the model is "mirrored" in X-axis.

I can fix the Title by changing x with z when importing. but my normals is always wrong then and i cant fix it.

 

my code looks like this.

 

model = my directX model that has vertex Vector3 and normaol Vector3 and u,v float for mapping.

 

//When i just import the model i use this:

 

model.vertex.x = import.vertex.x;

model.vertex.y = import.vertex.y;

model.vertex.z = import.vertex.z;

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

model.normal.x = import.normal.x;

model.normal.y = import.normal.y;

model.normal.z = import.normal.z;

 

this is just 1->1 import and gives me titled result with mirrored x-axis.

 

I have tried this, but it wont work, the model is right but my normals and uv-mapping is wrong...

 

 

model.vertex.x = -import.vertex.x;

model.vertex.y = import.vertex.z;

model.vertex.z = -import.vertex.y;

 

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

//No mather what i set my normals to it is still wrong normals...

model.normal.x = -import.normal.x;

model.normal.y = import.normal.z;

model.normal.z = i-mport.normal.y;

 

 

How should my import routine look like for my vertex and normals plus uv?


#2KurtO

Posted 13 February 2013 - 02:52 AM

I know blender is using the right-handed and DirectX is using Left handed coordinate system.

Of course this is creating some problem with my export.

 

But my problem isn´t logical.

 

I have made the simplest model in Blender and then export vertex-list x,y,z and normal x,y,z and u,v for texture mappings.

 

dx = direct x variable

bx = blender x variable etc...

 

If i import my model with x = x, y = y, z = z from blender to DirectX in both vertex and normals my model is drawned like this:

 

It is 90 degrees tilted (this is understandable and logic), BUT also the model is "mirrored" in X-axis.

I can fix the Title by changing x with z when importing. but my normals is always wrong then and i cant fix it.

 

my code looks like this.

 

model = my directX model that has vertex Vector3 and normaol Vector3 and u,v float for mapping.

 

//When i just import the model i use this:

 

model.vertex.x = import.vertex.x;

model.vertex.y = import.vertex.y;

model.vertex.z = import.vertex.z;

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

model.normal.x = import.normal.x;

model.normal.y = import.normal.y;

model.normal.z = import.normal.z;

 

this is just 1->1 import and gives me titled result with mirrored x-axis.

 

I have tried this, but it wont work, the model is right but my normals and uv-mapping is wrong...

 

 

model.vertex.x = -import.vertex.x;

model.vertex.y = import.vertex.z;

model.vertex.z = -import.vertex.y;

 

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

//No mather what i set my normals to it is still wrong normals...

model.normal.x = -import.normal.x;

model.normal.y = import.normal.z;

model.normal.z = i-mport.normal.y;

 

 

How should my import routine look like for my vertex and normals plus uv?


#1KurtO

Posted 13 February 2013 - 02:52 AM

I know blender is using the right-handed and DirectX is using Left handed coordinate system.

Of course this is creating some problem with my export.

 

But my problem isn´t logical.

 

I have made the simplest model in Blender and then export vertex-list och x,y,z and normal x,y,z and u,v for texture mappings.

 

dx = direct x variable

bx = blender x variable etc...

 

If i import my model with x = x, y = y, z = z from blender to DirectX in both vertex and normals my model is drawned like this:

 

It is 90 degrees tilted (this is understandable and logic), BUT also the model is "mirrored" in X-axis.

I can fix the Title by changing x with z when importing. but my normals is always wrong then and i cant fix it.

 

my code looks like this.

 

model = my directX model that has vertex Vector3 and normaol Vector3 and u,v float for mapping.

 

//When i just import the model i use this:

 

model.vertex.x = import.vertex.x;

model.vertex.y = import.vertex.y;

model.vertex.z = import.vertex.z;

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

model.normal.x = import.normal.x;

model.normal.y = import.normal.y;

model.normal.z = import.normal.z;

 

this is just 1->1 import and gives me titled result with mirrored x-axis.

 

I have tried this, but it wont work, the model is right but my normals and uv-mapping is wrong...

 

 

model.vertex.x = -import.vertex.x;

model.vertex.y = import.vertex.z;

model.vertex.z = -import.vertex.y;

 

model.texture.u = 1-import.texture.u;

model.texture.v = import.texture.v;

 

//No mather what i set my normals to it is still wrong normals...

model.normal.x = -import.normal.x;

model.normal.y = import.normal.z;

model.normal.z = i-mport.normal.y;

 

 

How should my import routine look like for my vertex and normals plus uv?

 


PARTNERS