TexturedShapes
I want to apply a texture to a little box (width=0.4m - height=0.8m - depth=0.001m), but during the simulation my jpg image is resized and I don't know why.
Is it possible to set the size for the jpg texture?
I use that simAssets code from xml simulation manifest:
<
sim:Assets><
sim
efaultTexture>NAME_OF_MY_TEXTURE.jpg</sim
efaultTexture><
sim:Effect>simplevisualizer_2_0.fx</sim:Effect></
sim:Assets>
[1582 byte] By [
HumaN] at [2008-2-7]
When you don't specify a mesh for an entity, the simulation engine builds a mesh from the physics shape. When it builds the mesh, it assigns default texture coordinates to each vertex. In the case of the cube, the texture coordinates are generated so that the size of the texture map is constant. On a cube that is 0.1 meters square, each face will show only the top 1/10th corner of the texture. On a cube that is 1 meter square, the entire texture map will be shown on each face. On a cube that is 2 meters square, the texture map will be shown four times on each face (doubled in each direction).
That is the default behavior of the cube. If you want your texture to display differently, it will be necessary to define a mesh (.obj) file that defines a cube. Then you are free to specify any texture coordinates you want at each vertex.
Here is a description of the .obj format with some examples that should make it pretty easy to define your own cube with custom texture coordinates:
http://www.fileformat.info/format/wavefrontobj/
-Kyle