Re: [osg-users] Newbie Texture Question

2011-10-09 Thread Chris 'Xenon' Hanson
On 10/9/2011 9:28 AM, Robbo wrote: I am trying to learn OSG for use in Flightgear. I have seen a technique used regularly that I am not able to figure out. Essentially a scene is using an rgb file which is transparent and whilst quite large (1024x768), contains many different 'icons' of

Re: [osg-users] newbie texture question

2010-02-22 Thread Alberto Luaces
David Cofer writes: I added the recommended line to the mtl file and it did apply the texture to the object this time, but it was still incorrect compared to what is seen in directx. See picture. I tried a couple of the options for the map_Kd command and none helped. I think the

Re: [osg-users] newbie texture question

2010-02-22 Thread David Cofer
You rock Alberto!! I flipped the bmp and it mapped correctly. It would never have occured to me to do that in a million years on my own. Thanks. I tried to step into the osg code, but it did not work. It just stepped over it. I am loading the debug versions, so I am not completly sure why it is

Re: [osg-users] newbie texture question

2010-02-22 Thread Jean-Sébastien Guay
Hi David, I will keep playing with it to see if it is dropping the u,v coords as you suspect. Worst case scenario I just remove the ability to apply a texture at run-time for a mesh and make them specify it in the mesh file. Or, just map a dummy white 1x1 texture by default, so that the obj

Re: [osg-users] newbie texture question

2010-02-22 Thread Alberto Luaces
David Cofer writes: You rock Alberto!! I flipped the bmp and it mapped correctly. It would never have occured to me to do that in a million years on my own. Thanks. Glad I could help :) See below. I tried to step into the osg code, but it did not work. It just stepped over it. I am

Re: [osg-users] newbie texture question

2010-02-22 Thread Jason Daly
David Cofer wrote: You rock Alberto!! I flipped the bmp and it mapped correctly. It would never have occured to me to do that in a million years on my own. Thanks. Random facts you may or may not care about... DirectX uses a different origin from OpenGL when applying textures (DirectX

Re: [osg-users] newbie texture question

2010-02-22 Thread David Cofer
Ok. I can get the mesh to work using the mtl file, but I have gone back and tried to get the basic geometric textures working and I am still having problems. I created a simple geometry for a box using the code shown below. I set it up to try and place the texture file once on each face. When I

Re: [osg-users] newbie texture question

2010-02-22 Thread David Cofer
A previous post suggested I try something other than a bmp. So just to make sure it was not my image I tried a different jpg instead and it worked fine. I then went back and tried it just using the standard osg::box and it worked as well. So It looks like the bulk of my problems was the image

Re: [osg-users] newbie texture question

2010-02-20 Thread Robert Osfield
Hi David, The osg::ShapeDrawable classes is only simply convenience classes, it isn't able to map all the possible combinations of the way you might want to apply. For fine control you have to use osg::Geometry to build up the coordinates and texture coordinates yourself. See the osggeometry

Re: [osg-users] newbie texture question

2010-02-20 Thread David Cofer
Ok. I still think it is silly that the default implementation does not produce a basic texture mapping, but I will accept that. However, I also tested a texture mapping using a loaded .obj file. It has the explicit u,v texture coordinates defined in the file, but it still does not work. I have

Re: [osg-users] newbie texture question

2010-02-20 Thread Alberto Luaces
David Cofer writes: [...] I also tested a texture mapping using a loaded .obj file. It has the explicit u,v texture coordinates defined in the file, but it still does not work. I have to be missing something here. Yes. There is no need to create an StateSet here. The problem is that your

Re: [osg-users] newbie texture question

2010-02-20 Thread David Cofer
I added the recommended line to the mtl file and it did apply the texture to the object this time, but it was still incorrect compared to what is seen in directx. See picture. I tried a couple of the options for the map_Kd command and none helped. Also, this will not help me in the long run