Rectangles and Textures

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Dandrolvorn
Posts: 15
Joined: Thu Apr 20, 2006 4:31 pm

Rectangles and Textures

Post 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
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post 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)
If you don't have anything nice to say, don't say anything at all.
Dandrolvorn
Posts: 15
Joined: Thu Apr 20, 2006 4:31 pm

Post by Dandrolvorn »

thanks alot, it works ;)
Post Reply