[osg-users] Problem with osgAnimationViewer example

2009-02-11 Thread Aitor Arrieta
Hi all

My name is Aitor Arrieta and I am currently working for VICOMTech Research
Center in Donosti (Spain). We have differente projects in which we use some
animated avatars in an OSG environment so we are interested in the new
osg::Animation plugin.

I have downloaded the new osg version (2.8.0) in which this plugin is
included and I have successfully compiled it. The problem comes when I try
to execute the animation examples. There is no problem with all of them but
with the osg animation viewer. I will try to explain it.

Frist of all, when I run osganimationviewer.exe example.osg the
application gives me the following error: osganimationviewer.exe: no data
loaded. That is, the error comes when the program tries to read the
example.osg node file. However, if I run osganimationviewer.exe
cessna.osg (cessna.osg is taken from an older version of osg) the program
runs ok (there are some other errors but at least I can see the object
loaded in the scene).

This means that maybe the program does not find any dll (or something like
that) in order to load the osg file. I am running the example from the /bin
directory of osg and I have even copied all the dll-s from the
osgplugins-2.8.0 folder there too. The example.osg file is also in the
same directory. I have also osg 2.4 installed in my computer but this is not
a problem, is it?

As you can see, I am not an expert with osg so sorry if my question sounds
stupid. And sorry for my bad english too.

I look forward to hearing from you. Thank you very much in advance.

Regards,

Aitor


-- 
Aitor Arrieta Larrea
Investigador colaborador / Research Assistant

VICOMTech - Visual Interaction and Communication Technologies Center
Mikeletegi Pasealekua, 57 - Parque Tecnológico
E-20009 Donostia - San Sebastián, Spain
Tel: +[34] 943 30 92 30
Fax: +[34] 943 30 93 93
e-mail: aarri...@vicomtech.org
http://www.vicomtech.org

*** member of INI-GraphicsNet 
http://www.inigraphics.net
*** member of IK4 Research Alliance 
http://www.ik4.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with osgAnimationViewer example

2009-02-12 Thread Aitor Arrieta
Hi all

Thank you very much for your help. I really appreciate it. I have downloaded
the trunk version from svn and now everything works ok (well, I don't see
the images on the buttons but this is not relevant).

It looks really nice and I think it will be very helpful for us. However,
now I have a lot of questions like, for example, how can I create my own osg
animated files? I mean , is it possible to do it from Maya, Poser, Blender,
etc...? Or how does the bvh plugin work? Does it create a new skeleton from
the bvh file or can I import the animation into an existing figure, even
having different skeletons?

I've been looking in your web but I'm not able to find any documentation
about all these new features. Maybe you're working on it right now?

Well, I look forward to hearing from you. Thanks again for your help.

Cheers,

AItor



-- 
Aitor Arrieta Larrea
Investigador colaborador / Research Assistant

VICOMTech - Visual Interaction and Communication Technologies Center
Mikeletegi Pasealekua, 57 - Parque Tecnológico
E-20009 Donostia - San Sebastián, Spain
Tel: +[34] 943 30 92 30
Fax: +[34] 943 30 93 93
e-mail: aarri...@vicomtech.org
http://www.vicomtech.org

*** member of INI-GraphicsNet 
http://www.inigraphics.net
*** member of IK4 Research Alliance 
http://www.ik4.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using different textures for the same geometry

2008-10-09 Thread Aitor Arrieta
Hi all

First of all, this is my first time writing here so sorry if I do something
wrong...

Here is my question. I have an obj file, which I have exported from Poser. I
have modified this file in order to have only one geometry, that is, there
is only one osg::node. This new file works fine in my application and I can
see the figure with no problems. However, the problem comes when I try to
apply the original textures to this figure, because I have more than one
image files for the single osg::Node.

As far as I know, there could be two different solutions for this problem:

1- Create a single texture combining all the textures I have and then apply
it to the node
2- Apply a different texture to each vertex group

For the first one, I have googled for some days and I am not able to find a
program which can do it.
For the second one, I know which vertex should be with any of the different
textures, but I do not know the way to do it from c++ using the osg
libraries.

Can anyone please help me? I know that my explanation was not very good so
if you need further information just ask for it.

Thank you very much in advance.

Regards,

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


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Aitor Arrieta
Hi Robert,

Thank you very much for your reply.

I have a single geometry and I want to apply different textures for it. That
is, imagine a figure of a woman which is a single geometry. However, I have
a texture for the head, another one for the body, another one for the shirt,
etc... Do you understand? Sorry if I explained it badly, but I am not good
explaining things and even worse in english :)

Thanks a lot for your reply Robert,

Regards,

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


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Aitor Arrieta
Hi Paul

Thank you very much for your reply.

I think it will be easier to take the solution #2. For our application, the
only restriction we have is that we must use a single vertex array. But if
you say that this is possible to do even when using different geometries, I
will investigate more about this option.

Thanks a lot Paul

Regards,

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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-14 Thread Aitor Arrieta
Hi Paul

Thanks a lot for your reply, but unfortunately I think that my question is not 
as
simple as you think. Sorry because it was my fault as I did not explain myself
correctly.

The problem is that I must have a single vertex arrays for many
different geometries but each geometry uses only a part of this vertex
array. That is, imagine a single vertex array with indices from 1 to
100. I should have geometry 1 with indices from 1 to 10, geometry 2
with indices from 11 to 20, etc. But all of them sharing the same
vertex array, which is used to do some other things.

Sorry for my bad explanation and thanks again for your reply.

Best regards,

Aitor






- Mensaje original 
De: Paul Martz [EMAIL PROTECTED]
Para: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre, 2008 16:54:00
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes


osg::Geometry* geom0 = new osg::Geometry;
osg::Geometry* geom1 = new osg::Geometry;
osg::Vec3Array* verts = osg::Vec3Array;
geom0-setVertexArray( verts 
);
geom1-setVertexArray( verts 
);
 
Hope that 
helps.
   
-Paul



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor  Arrieta
Sent: Tuesday, October 14, 2008 8:39 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Sharing  Vertex Arrays between Geometry Nodes


Hi all,
 
I am developing an application in which I have to share the same vertex  array 
between different nodes in order to apply a different texture to each of  them. 
I know that this is possible to do because I have read  it. However, I am a 
beginner in the osg world and I am not able to find the  way to do it.
 
Someone told me that I could use the same geode having different  geometries 
but how can I specify a vertex array for a geode? As far  as I know this is 
impossible, is not it?
I have also read something about using the DrawElementsUShort primitive  but 
how should I use it?
 
My question is: is there any example of sharing vertex arrays  between geometry 
nodes anywhere? Or has anybody done this before? In  short, could anybody 
please help me with this task?
 
Thank you very much in advance.
 
Regards,
 
Aitor



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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-14 Thread Aitor Arrieta
Hi Paul

Thanks again for your prompt reply and sorry for my stupid message. As I have 
said before, I am completely a beginner in this osg world

I will try to apply your code and see what happens.

Regards,

Aitor





- Mensaje original 
De: Paul Martz [EMAIL PROTECTED]
Para: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre, 2008 17:38:17
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes


The code I posted will work for the use case you describe. Indices are 
part of the PrimitiveSet; assign a different PrimitiveSet (with different 
indices) to each Geometry and they will index into the same vertex 
array.
   -Paul
 



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor  Arrieta
Sent: Tuesday, October 14, 2008 9:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Sharing Vertex Arrays  between Geometry Nodes


Hi Paul

Thanks a lot for your reply, but unfortunately I think  that my question is not 
as simple as you think. Sorry because it was my fault  as I did not explain 
myself correctly.

The problem is that I must have  a single vertex arrays for many different 
geometries but each geometry uses  only a part of this vertex array.. That is, 
imagine a single vertex array with  indices from 1 to 100. I should have 
geometry 1 with indices from 1 to 10,  geometry 2 with indices from 11 to 20, 
etc. But all of them sharing the same  vertex array, which is used to do some 
other things.

Sorry for my bad  explanation and thanks again for your reply.

Best  regards,

Aitor






-  Mensaje original 
De: Paul Martz  [EMAIL PROTECTED]
Para: OpenSceneGraph Users  osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre,  2008 16:54:00
Asunto: Re: [osg-users] Sharing Vertex Arrays between  Geometry Nodes


osg::Geometry* geom0 = new osg::Geometry;
osg::Geometry* geom1 = new osg::Geometry;
osg::Vec3Array* verts = osg::Vec3Array;
geom0-setVertexArray(  verts );
geom1-setVertexArray(  verts );
 
Hope that  helps.
-Paul



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor Arrieta
Sent: Tuesday, October 14, 2008 8:39  AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Sharing Vertex Arrays between Geometry 
Nodes


Hi all,
 
I am developing an application in which I have to share the same vertex  array 
between different nodes in order to apply a different texture to each  of them. 
I know that this is possible to do because I have  read it. However, I am a 
beginner in the osg world and I am not able to find  the way to do it.
 
Someone told me that I could use the same geode having different  geometries 
but how can I specify a vertex array for a geode? As  far as I know this is 
impossible, is not it?
I have also read something about using the DrawElementsUShort primitive  but 
how should I use it?
 
My question is: is there any example of sharing vertex arrays  between geometry 
nodes anywhere? Or has anybody done this before? In  short, could anybody 
please help me with this task?
 
Thank you very much in advance.
 
Regards,
 
Aitor


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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-15 Thread Aitor Arrieta
Hi Paul

I don't know if this is a stupid question or not but I'm already going crazy... 

I can't use your code because I don't create new geometries. Instead of this, I 
get an osg::geode from an obj file. At this moment, I can only get a single 
geometry from the geode and apply a single texture to it. But this is not what 
I want.

The obj file represents a human figure, and I would like to separate the head 
from the body because they have different textures. I know which vertices are 
from the head and which ones for the body so this won't be a problem in this 
case. The problem is that they must share the same vertex array, which is used 
to do some morph tasks. My question is, how can I create two different 
geometries starting from the same geode and sharing the same vertex array? Is 
this possible or not?

Thanks a lot Paul and sorry for the inconveniences

Regards,

Aitor








- Mensaje original 
De: Paul Martz [EMAIL PROTECTED]
Para: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre, 2008 17:38:17
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes


The code I posted will work for the use case you describe. Indices are 
part of the PrimitiveSet; assign a different PrimitiveSet (with different 
indices) to each Geometry and they will index into the same vertex 
array.
   -Paul
 



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor  Arrieta
Sent: Tuesday, October 14, 2008 9:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Sharing Vertex Arrays  between Geometry Nodes


Hi Paul

Thanks a lot for your reply, but unfortunately I think  that my question is not 
as simple as you think. Sorry because it was my fault  as I did not explain 
myself correctly.

The problem is that I must have  a single vertex arrays for many different 
geometries but each geometry uses  only a part of this vertex array.. That is, 
imagine a single vertex array with  indices from 1 to 100. I should have 
geometry 1 with indices from 1 to 10,  geometry 2 with indices from 11 to 20, 
etc. But all of them sharing the same  vertex array, which is used to do some 
other things.

Sorry for my bad  explanation and thanks again for your reply.

Best  regards,

Aitor






-  Mensaje original 
De: Paul Martz  [EMAIL PROTECTED]
Para: OpenSceneGraph Users  osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre,  2008 16:54:00
Asunto: Re: [osg-users] Sharing Vertex Arrays between  Geometry Nodes


osg::Geometry* geom0 = new osg::Geometry;
osg::Geometry* geom1 = new osg::Geometry;
osg::Vec3Array* verts = osg::Vec3Array;
geom0-setVertexArray(  verts );
geom1-setVertexArray(  verts );
 
Hope that  helps.
-Paul



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor Arrieta
Sent: Tuesday, October 14, 2008 8:39  AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Sharing Vertex Arrays between Geometry 
Nodes


Hi all,
 
I am developing an application in which I have to share the same vertex  array 
between different nodes in order to apply a different texture to each  of them. 
I know that this is possible to do because I have  read it. However, I am a 
beginner in the osg world and I am not able to find  the way to do it.
 
Someone told me that I could use the same geode having different  geometries 
but how can I specify a vertex array for a geode? As  far as I know this is 
impossible, is not it?
I have also read something about using the DrawElementsUShort primitive  but 
how should I use it?
 
My question is: is there any example of sharing vertex arrays  between geometry 
nodes anywhere? Or has anybody done this before? In  short, could anybody 
please help me with this task?
 
Thank you very much in advance.
 
Regards,
 
Aitor


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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-15 Thread Aitor Arrieta
Hi Paul

I don't know but maybe... Would it be easier to combine both textures
(head and body) and create a new obj file using this new texture? You
should take into account that I have never done something like that (I
don't know even which program should I use)

Regards,

Aitor





- Mensaje original 
De: Paul Martz [EMAIL PROTECTED]
Para: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre, 2008 17:38:17
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes


The code I posted will work for the use case you describe. Indices are 
part of the PrimitiveSet; assign a different PrimitiveSet (with different 
indices) to each Geometry and they will index into the same vertex 
array.
   -Paul
 



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor  Arrieta
Sent: Tuesday, October 14, 2008 9:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Sharing Vertex Arrays  between Geometry Nodes


Hi Paul

Thanks a lot for your reply, but unfortunately I think  that my question is not 
as simple as you think. Sorry because it was my fault  as I did not explain 
myself correctly.

The problem is that I must have  a single vertex arrays for many different 
geometries but each geometry uses  only a part of this vertex array.. That is, 
imagine a single vertex array with  indices from 1 to 100. I should have 
geometry 1 with indices from 1 to 10,  geometry 2 with indices from 11 to 20, 
etc.. But all of them sharing the same  vertex array, which is used to do some 
other things.

Sorry for my bad  explanation and thanks again for your reply.

Best  regards,

Aitor






-  Mensaje original 
De: Paul Martz  [EMAIL PROTECTED]
Para: OpenSceneGraph Users  osg-users@lists.openscenegraph.org
Enviado: martes, 14 de octubre,  2008 16:54:00
Asunto: Re: [osg-users] Sharing Vertex Arrays between  Geometry Nodes


osg::Geometry* geom0 = new osg::Geometry;
osg::Geometry* geom1 = new osg::Geometry;
osg::Vec3Array* verts = osg::Vec3Array;
geom0-setVertexArray(  verts );
geom1-setVertexArray(  verts );
 
Hope that  helps.
-Paul



 From: [EMAIL PROTECTED]  [mailto:[EMAIL PROTECTED] On Behalf Of Aitor Arrieta
Sent: Tuesday, October 14, 2008 8:39  AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Sharing Vertex Arrays between Geometry 
Nodes


Hi all,
 
I am developing an application in which I have to share the same vertex  array 
between different nodes in order to apply a different texture to each  of them. 
I know that this is possible to do because I have  read it. However, I am a 
beginner in the osg world and I am not able to find  the way to do it.
 
Someone told me that I could use the same geode having different  geometries 
but how can I specify a vertex array for a geode? As  far as I know this is 
impossible, is not it?
I have also read something about using the DrawElementsUShort primitive  but 
how should I use it?
 
My question is: is there any example of sharing vertex arrays  between geometry 
nodes anywhere? Or has anybody done this before? In  short, could anybody 
please help me with this task?
 
Thank you very much in advance.
 
Regards,
 
Aitor


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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-16 Thread Aitor Arrieta
Hi J-S and Paul

Thanks a lot for your reply. I would like to be able to have a correct model 
from the beginning but unfortunately I must use a given obj file...

So I don't have any option but trying to solve my problem by code. I have been 
doing some tests today and at this moment I'm able to separate the two 
geometries applying different textures for each of them and sharing the same 
vertex array but with different primitive sets. I'm still having some problems 
with the vertices near the neck but I think that I know how to solve them. 
Let's wait until tomorrow...

I'm also having some strange problems with the light or something like that 
because I only see the textures from the back of the human figure. If I see the 
figure from the front everything is black... It's strange because when I had 
only a single geometry everything was ok and I have not set anything about 
lights after that... Maybe it could be a problem with the normals but if I 
remove the normal array from the geometries the problem is still there. Do you 
know what could be happenning?

Thank you very much for your help.

Regards,

Aitor






- Mensaje original 
De: Jean-Sébastien Guay [EMAIL PROTECTED]
Para: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Enviado: miércoles, 15 de octubre, 2008 16:29:59
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

Hi Aitor,

 I can't use your code because I don't create new geometries. Instead of 
 this, I get an osg::geode from an obj file. At this moment, I can only 
 get a single geometry from the geode and apply a single texture to it. 
 But this is not what I want.
 
 The obj file represents a human figure, and I would like to separate the 
 head from the body because they have different textures. I know which 
 vertices are from the head and which ones for the body so this won't be 
 a problem in this case. The problem is that they must share the same 
 vertex array, which is used to do some morph tasks. My question is, how 
 can I create two different geometries starting from the same geode and 
 sharing the same vertex array? Is this possible or not?

Your life would be simpler if you could get a correct model as soon as 
you load it, instead of trying to massage it (and how you massage it 
might change from one model to the next).

However, yes, what you ask is possible. You can traverse your model to 
the Geode which contains the Geometry, then create new Geometry objects, 
attach them to the Geode, and remove the original one. The new Geometry 
objects can reference the original one's vertex arrays, and then when 
you remove the original one from the Geode the vertex arrays won't be 
deleted because other Geometry objects reference them.

Then on your new Geometry object(s), you can do what you want. So you 
could add primitive sets for the correct vertices to be used, you could 
add texture coordinate arrays (or reuse those from the original Geometry 
object), etc.

As I said, it's a lot of trouble. If you can get a valid model right 
away, your life will be easier. It's not the kind of thing that's best 
done in code... Modeling tools are specialized in manipulating these 
kinds of things...

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



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


Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

2008-10-21 Thread Aitor Arrieta
Hi J-S, Paul and Robert

After some days and several hours of work, I can finally say that my 
application is now working fine. Of course I could never have solved my problem 
without your help so I have no words to show my gratitude.

Thanks a lot for your help.

Regards,

Aitor





- Mensaje original 
De: Jean-Sébastien Guay [EMAIL PROTECTED]
Para: OpenSceneGraph Users [EMAIL PROTECTED]
Enviado: jueves, 16 de octubre, 2008 18:31:30
Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes

Hi Aitor,

 I'm also having some strange problems with the light or something like 
 that because I only see the textures from the back of the human figure. 
 If I see the figure from the front everything is black... It's strange 
 because when I had only a single geometry everything was ok and I have 
 not set anything about lights after that... Maybe it could be a problem 
 with the normals but if I remove the normal array from the geometries 
 the problem is still there. Do you know what could be happenning?

Did you copy the other arrays from the original Geometry object to the 
new one(s)? The normal array and color arrays need to be copied, and 
normalBinding and colorBinding need to be set to BIND_PER_VERTEX..

Actually, I think just cloning the original Geometry object, removing 
any PrimitiveSets it had, and then adding new ones would work best, 
least chance to make a mistake copying things yourself.

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



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