Actually I don't understand what's your problem. May be you can post an image showing what's not working.
I think you can get it by using 2D, discarding the "Z" axis. Better if you use orthogonal to prevent transformations.
Actually I don't understand what's your problem. May be you can post an image showing what's not working.
I think you can get it by using 2D, discarding the "Z" axis. Better if you use orthogonal to prevent transformations.
No signature provided yet.
I recently discovered on some quads, that texture isn't going smoothly along the whole image. I am unsure how this would look, but i would try by adding 1 vertex in the average middle point of quad. That way you would render it as 5 point GL_TRIANGLE_FAN, where v0 is center of quad.
Unfortunatly, I'm unsure what your saying XD
I am already rending in 2D, that's what zenGL does, although I'm unsure if it's in orthogonal mode, how do you change projections with OpenGL?
It's not the texture not matching up or not being smooth that's the issue.
I'll try and actually show the issue:
If you look at the slope the texture doesn't run along the line (The horizontal lines on the brick wall are meant to become parallel to the slope of the wall).
This is going across two, up two and as you can see from the images in the one above going one and and one across results in the correct distortion.
Here's one with a triangle overlay:
And here (in blue) is the path it follows, and (in yellow) the path it should follow:
Basically when the y-differnce is greater than cGridsize the texture is incorrectly distorted, making the horizontal lines on the texture not parallel to the top/bottom of the wall.
Edit: I just got it to work... and it was stupidly simple!
TexCoord[0].x := Tri[0].x/cGridsize;
TexCoord[0].y := Tri[0].y/cGridsize;
TexCoord[1].x := Tri[1].x/cGridsize;
TexCoord[1].y :=Tri[0].y/cGridsize+1;
TexCoord[2].x := Tri[3].x/cGridsize;
TexCoord[2].y := Tri[0].y/cGridsize+1;
All I have to do is make it so that it doesn't repeat along the y axis because apparently the texture was repeating vertically, when it shouldn't >.>
Sorry to have wasted your time, and thanks for trying to help me out! XD
Last edited by Draghi; 31-12-2012 at 12:27 AM.
There are several ways. You can just define the matrix directly, but you should use use glOrtho for orthographic and glFrustrum for pyramidal as they're designed for it.
No signature provided yet.
Bookmarks