Jump to content
  • Advertisement
Sign in to follow this  
BlessmanTsanga

left handed coordinate system and OBJ files?

This topic is 2592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi

Does an obj file format like the one in 3D max, support a right handed coordinate system only via export? I've been worriying about this since it would mean that I would have to plan for a way to convert such coordinates in order to import them to my left-handed coordinate system.

Share this post


Link to post
Share on other sites
Advertisement
Handedness is not an attribute of the .OBJ file format, it is purely a function of the exporter and importer. An .OBJ file only handles data. I'm only familiar with the Blender exporter for .OBJ, but it allows you to specify the axes upon export, converting from Blender's coordinate system to the coordinate system specified by your choice of Forward and Up axes. So I'd imagine that if the free and open source software does it, then the commercial one probably does as well.

Share this post


Link to post
Share on other sites

Handedness is not an attribute of the .OBJ file format, it is purely a function of the exporter and importer. An .OBJ file only handles data. I'm only familiar with the Blender exporter for .OBJ, but it allows you to specify the axes upon export, converting from Blender's coordinate system to the coordinate system specified by your choice of Forward and Up axes. So I'd imagine that if the free and open source software does it, then the commercial one probably does as well.


thanks

Share this post


Link to post
Share on other sites
but just so you know, it is very easy to convert a model from a right handed coordinate system to left hand.

1. Invert the z-axis by multiplying it with -1.0f (vertex position, normal, etc.)

2. invert the v axis of texture coordinates by subtracting it from one (eg. texcoord.v = 1 - texcoord.v)

In my functions, just in case I have a boolean parameter that is true if it a right handed model, and false if it is not. if it is a right handed model, then the conversion is done while loading the model, otherwise, the conversion is not done.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!