Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2011-02-07 Thread Robert Pardridge
Hi,

The problem is I get back a null pointer for options after using this: 

osgDB::ReaderWriter::Options* options 
=osgDB::Registry::instance()-getOptions();

I am guessing the options string I want is specific to the obj plugin, so do I 
need to tell the registry I am using that plugin? To load the obj all I am 
doing is this:

Node*node = osgDB::readNodeFile(myobject.obj);

I can load the object fine but its at the wrong orientation, and I want to fix 
that just like the original post.

Thank you!

Cheers,
Robert

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36442#36442





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2011-02-06 Thread Robert Osfield
Hi Robert,

On Sat, Feb 5, 2011 at 7:37 PM, Robert Pardridge bobbyucsd...@yahoo.com wrote:
 how exactly do you modify the options string with c++ code?

 osgDB::ReaderWriter::Options* options = 
 osgDB::Registry::instance()-getOptions();

Might I suggest you look at the header for Options?

When you do you'll find a Options::setOptionString(const std::string)
method ;-)

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2011-02-05 Thread Robert Pardridge
how exactly do you modify the options string with c++ code?

osgDB::ReaderWriter::Options* options = 
osgDB::Registry::instance()-getOptions();

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36393#36393





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Gianni Ambrosio
Hi,
is there a way to set noRotation option again to the default value?

Regards
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29479#29479





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Alberto Luaces
Gianni Ambrosio writes:

 Hi,
 is there a way to set noRotation option again to the default value?

I don't know if it is possible from the command line. You could
osgconvert the files that are in odd orientations.

Programmatically, just don't use the same osgDB::Options object in the
next read.

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Gianni Ambrosio

Alberto Luaces wrote:
 
 Programmatically, just don't use the same osgDB::Options object in the
 next read.
 

Yes Alberto, I mean programmatically.

What do you mean by that? What if I would like to use the existing 
osgDB::ReaderWriter::Options as is but just without the noRotation setting? 
If I overwrite the Options object I think I would loose all the other options.

Regards
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29484#29484





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Alberto Luaces
Hi Gianni,

Gianni Ambrosio writes:

 Alberto Luaces wrote:
 
 Programmatically, just don't use the same osgDB::Options object in the
 next read.
 

 Yes Alberto, I mean programmatically.

 What do you mean by that? What if I would like to use the existing 
 osgDB::ReaderWriter::Options as is but just without the noRotation setting? 
 If I overwrite the Options object I think I would loose all the other options.

Then you can use osgDB::ReaderWriter::Options::getOptionString(), remove
noRotation there and then apply it again with
osgDB::ReaderWriter::Options::setOptionString(). Or better, have two
osgDB::ReaderWriter::Options objects...

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Gianni Ambrosio
Hi Alberto,

Alberto Luaces wrote:
 remove
 noRotation

probably my question is too stupid ... how can I remove it?
I tried with:

osgDB::ReaderWriter::Options* options = 
osgDB::Registry::instance()-getOptions();
options-removePluginData(noRotation)

but it does not seem to work. I mean the Options object still contains the 
noRetation string inside.

Regards,
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29493#29493





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2010-06-29 Thread Gianni Ambrosio
OK, I think I didn't get the usage of the option string. I thought I could set 
a single option but it seems I have to set the whole option string again. So 
I have to parse the string to remove the noRotation substring ... if so, from 
my point of view it is not a user friendly API.

Regards
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29496#29496





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2009-09-30 Thread Claus Scheiblauer
Hi,

I am using the obj plugin to load polygonal models, but it seems that the 
models are placed at wrong positions and with a wrong attitude in the 
coordinate system. I have a model that is centered at (1014, 1025, 999), but it 
is placed at coordinates (1014, -999, 1025).

In the program we use we have a view matrix that is not the identity matrix, it 
looks like this:

1  0  0  0
0  0  1  0
0 -1  0  0
0  0  0  1

so probably the view matrix is not considered by the obj plugin. I tried it 
with 3DS models, and these are placed correctly into the scene, so I think this 
could be a bug in the obj plugin.

Another issue is, that there also seems to be a rotation of 90 degrees about 
the (-1, 0, 0) axis so the imported OBJ models are displaced and wrongly 
oriented.

I would like to ask if there is something I can do about this? One way would be 
to make a workaround in our program, but maybe there is already a feature in 
OSG that addresses these issues?  

Thank you!

Cheers,
Claus

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17740#17740





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2009-09-30 Thread Alberto Luaces
Hi Claus,

Claus Scheiblauer writes:

 Hi,

 I am using the obj plugin to load polygonal models, but it seems that the 
 models are placed at wrong positions and with a wrong attitude in the 
 coordinate system. I have a model that is centered at (1014, 1025, 999), but 
 it is placed at coordinates (1014, -999, 1025).

 In the program we use we have a view matrix that is not the identity matrix, 
 it looks like this:

 1  0  0  0
 0  0  1  0
 0 -1  0  0
 0  0  0  1

 so probably the view matrix is not considered by the obj plugin. I tried it 
 with 3DS models, and these are placed correctly into the scene, so I think 
 this could be a bug in the obj plugin.

 Another issue is, that there also seems to be a rotation of 90 degrees about 
 the (-1, 0, 0) axis so the imported OBJ models are displaced and wrongly 
 oriented.

 I would like to ask if there is something I can do about this? One way would 
 be to make a workaround in our program, but maybe there is already a feature 
 in OSG that addresses these issues?  

Reading the output of osgconv --formats, it is shown that the OBJ
plugin has an option to deactivate that rotation around the X axis. Its
name is noRotation. You should use it when loading the model from your
OSG code.

Regards,

Alberto
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OBJ plugin loader places model at wrong position and with wrong attitude

2009-09-30 Thread Claus Scheiblauer
Hi,

I was not aware that there are options for the loading plugin, thank you, this 
option solves both problems, now it works!


Cheers,
Claus

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17743#17743





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org