Page 1 of 1

Rectangles and Textures

Posted: Fri Mar 16, 2007 3:52 pm
by Dandrolvorn
I have a question ... ;)

Is it possible, to display only a part of a 74*63 Texture on a 3D Rectangle. Unitl now Irrlicht compresses the whole big texture on the small rectanlge, thats now what i´m want ... Hope you can help me



greets dandro

Posted: Fri Mar 16, 2007 4:17 pm
by Luben
You have to make your own scene node, to begin with.(Actually it's possible without scene node, but that's a different story)
The scene node should have four verticles, which make up two triangles. Those verticles have what is commonly called UV-coordinates, check this site for more info about them (http://nexe.gamedev.net/directKnowledge ... oordinates). Alternatively, google for "Texture coordinates".
You have to modify the UV-coords to display the area you want.
Basically its (1/Pixels)*PixelNumber to get the coord at a given pixel. (Both for x and y)

Posted: Fri Mar 16, 2007 8:17 pm
by Dandrolvorn
thanks alot, it works ;)