Different coordinate system for plug-in and vizard API?
Hi,
In the process of developing my osg based plug-in, I see that different coordinate systems are used for internal and external api. I.e. internal = osg, right handed and external = vizard api, left-handed. Can anyone confirm this difference and tell me how I should rotate my stuff in the plug-in in order to match the plug-in geometry and the vizard coordinate system? At the moment I use the osg based coordinate system with z up but this does not seem to work. Thanks a lot Raymond |
Which OSG methods are you using? Generally to convert a position/vector from Vizard to OSG reference frame you just need to negate the Z value. To convert a quaternion rotation from Vizard to OSG you need to negate the X and Y values.
OSG does use a Z-up convention, but you don't need to deal with that unless you are loading external models using the osgDB API. If this is the case, then you need to rotate the model 90 degrees about the x-axis by placing it under a osg::MatrixTransform with the following value: Code:
osg::Matrix::rotate(osg::DegreesToRadians(90.0),osg::Vec3(-1.0f,0.0f,0.0f)) |
Hi,
I am constructing an osg::Geode and osg::Geometry myself. And I fill the vertex coordinates (in a osg::ref_ptr So I am not going from Vizard to OSG, I am going from OSG to Vizard. Have you done something to the osg lib that you provide in the Vizard30API? Thanks a lot, best regards, Raymond |
If you are constructing the geometry within the Vizard plugin, then you just need to use the conversion I mentioned in my previous post:
Code:
3D Vectors: |
Hi,
(sorry I did not get back sooner on this, I did not work on this problem) This works indeed, partly. I also have to change the polygon winding, for vertex coordinates, normals and texture coordinates. But now my geometry is oriented properly. Hmm, this looks rather strange to me. You have changed the internals of osg then? Because in order to get the same results in Vizard via different ways, I have to fill the arrays in different order, inverted or not: OpenGL coord --> pure osg geometry (osg conversion) --> ive export --> Vizard and OpenGL coord --> Vizard plugin (Vizard conversion as you said) --> Vizard Can you confirm this? And also, do I need to know about other places where a conversion is needed like this? Thanks a lot Raymond |
All times are GMT -7. The time now is 01:56 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC