Hi,
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 smaller size and
what appears to be an
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
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
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
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
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
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
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
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
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
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
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
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
Hi,
I am new to OSG and I am attempting to port some work that was done in directX
over to OSG. I am using some of the basic geometric objects like osg::box and
osg::sphere. I got those working like I wanted, but when I tried to add texture
mapping to them the results are very different than
14 matches
Mail list logo