PDA

View Full Version : Mapping triangle to a right angle triangle



enigmagame
04-22-2008, 07:26 AM
I open this topic to speak about a texture map representation method.
Each triangle is mapped to a right angle triangle and these are packed together in arbitrary positions with a few pixels of padding between the triangles.
So, for example, if the model is a cube, this can be her texture map:
http://img232.imageshack.us/img232/4647/senzatitolo1du6.th.jpg (http://img232.imageshack.us/my.php?image=senzatitolo1du6.jpg)
First, simple case. If the model is a cube, the mapping is already done... But how can i render each triangle to a plane? I would obtain an image similar to the precedent.
Thanks!

tamlin
04-23-2008, 02:53 AM
???

What you just explained seems to be a texture atlas (you save multiple logical textures in a single GL texture), but with some (unusual) arbitrary offset to make them non-contigous. It seems especially strange to me to have diagonal separation, but I must assume you have a good reason for it.

Anyway, as you already (obviously) have to have an intemediate (proxy) "texture object" in your code that says what the GL texture name is, and what min/max s/t are (though with triangles like this, with diagonal separation, you then (again, obviously) have to have a somewhat more elaborate scheme).

Given that, ... I really fail to see the problem, or even understand the question - but then I fail to see why the diagonal separation was introduced in the first place.

enigmagame
04-23-2008, 04:12 AM
It seems especially strange to me to have diagonal separation, but I must assume you have a good reason for it.

I have made the image using "paint", only for give an idea, probably it's not correct.


Anyway, as you already (obviously) have to have an intemediate (proxy) "texture object" in your code that says what the GL texture name is, and what min/max s/t are (though with triangles like this, with diagonal separation, you then (again, obviously) have to have a somewhat more elaborate scheme).

I don't understand. I don't have any intermediate texture.
The method say: each triangle is mapped to a right angle triangle and these are packed together in arbitrary positions with a few pixels of padding between the triangles.
So, if my model is a cube, the triangles are already a right angle triangles, well how can i make the texture with this method?
Thanks!