garf
New Member
Posts: 3
|
Post by garf on Mar 5, 2006 22:40:27 GMT
Hi... I am having a problem with using VRML textures.
I am making a program where I am including vrml animations. I am putting a texture on a face set.. at the moment it's a square. The texture goes on fine, but I have found that when the height of the square, is greater then the width, the image is automatically rotated 90 degrees. Which is about 1.576rad.... Why is it doing this? And how can I fix it..
I have been rotating it so it goes back to normal, but sometimes it needs rotating, other times it does not.
I also don't know what the dimentions of the square will be, because the program generates it based on variables in the program...
So any help would be appreciated.
Thanks.
Gareth
|
|
|
Post by thyme on Mar 6, 2006 15:22:58 GMT
Hi Gareth Welcome to the Seamless3d forum For IndexedFaceSets when you don't specify a texture map of your own a default texture map is applied. In this case the orientation of the texture map is decided by how high or wide or deep the object is. This is why you are noticing the orientation of your texture flip at a right angle when you change the width or height of your rectangle. After the default texture has been established a TextureTransform node can be used to change the orientation to what ever it is you want it to be. I am not sure how well seamless3d conforms to the rules in how it applies a default texture to a IndexedfaceSet because I have not had enough time to properly check it. Therefore its best to verify the results in a browser too. You can get the VRML specs for default texture mapping from the web3d site: www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/nodesRef.html#IndexedFaceSetInstead of adjusting your texture orientation afterwards using a TextureTransform you might find it easier to apply your own texture map. For a simple example of 2 triangles using a texture map see my VRML tutorial mastering the triangle: www.seamless3d.com/tut/mastering_triangle/index.htmlSearch for the heading: Two Textured Triangles with Normals You have much more control over how your texture can be applied when you specify your own texture map, more than just the orientation of it so for anything more complex than simple objects this is the best way to go. You can generate textured objects using seamless3d build nodes and output the models as IndexedFaceSets which will be texture mapped. See the tutorial: www.seamless3d.com/tut/texture_mapping/index.htmlAlso there is a robot demonstration of how to apply a texture map to an object. Go to the F10 menu and select help/textured object demo You should put the texture: simple_texture.png from the file www.seamless3d.com/download/seamless_way_examples.zipin the same folder it creates the smls file. Hope this helps
|
|
garf
New Member
Posts: 3
|
Post by garf on Mar 6, 2006 22:11:51 GMT
Thank you very much... that was all very helpful...
I fixed what I needed to..
|
|