wrong default texture scale in custom scene node

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
blackMasoon
Posts: 149
Joined: Wed Sep 09, 2009 4:57 pm
Contact:

wrong default texture scale in custom scene node

Post by blackMasoon »

Hello. I have a problem with texturing my custom scene node. I use a texture 128x128 px and by default it looks like the texture matrix is scaled and moved a bit in a wrong direction. I set the wrap mode to repeat and texture scale: (1.0, 1.0) and it looks like repeated few times. When I change the wrap mode to clamp, it doesn't show the texture. My custom node is a simple polygon made of two triangles. What may be wrong?
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: wrong default texture scale in custom scene node

Post by smso »

Can you show how the vertices and indices are set up?

e.g.

Code: Select all

Vertices[0] = video::S3DVertex(-1.0f,-1.0f,0.0f, 0.0f,0.0f,1.0f, 0xFFFFFFFF, 0.0f,1.0f); 
 
...
Indices[0] = 0;
...
blackMasoon
Posts: 149
Joined: Wed Sep 09, 2009 4:57 pm
Contact:

Re: wrong default texture scale in custom scene node

Post by blackMasoon »

Oh... thanks for the clue... I forgot to initialize the UV coords of each vertex... Thanks :)
Post Reply