• Advertisement

Archived

This topic is now archived and is closed to further replies.

humm ... triangle strip problem

This topic is 5515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

when rendering a height maps i was thinking on how to do it before i could look at any tutorial i came up with this
    
for (X = 0; X <= Size; X += Jump)
{

  for (Y = 0; Y <= Size; Y += Jump)
  {
    x = X + Jump;					
    y = Height(X + Jump,Y);	
    z = Y;		
    glVertex3i (x,y,z);
	
    x = X;	
    y = Height(X,Y);	
    z = Y;		
    glVertex3i (x,y,z);
  }
}
  
Height is based on raw file.. so after doing this i get strange stuff life.. a map and then a bunch of line crosing the map.. why is this happening ? is it due that the Size of the map is a even number ? let's consider
3-----2
|   / |
| /   |
1-----0 
so if the last coord 1024 will be even where will the odd coord come so the strip completes ? [edited by - Metal Typhoon on January 21, 2003 12:26:20 PM]

Share this post


Link to post
Share on other sites
Advertisement
r u drawing it all in one strip then it wont work try this

for (X = 0; X <= Size; X += Jump)
{
begin strip
for (Y = 0; Y <= Size; Y += Jump)
{
x = X + Jump;
y = Height(X + Jump,Y);
z = Y;
glVertex3i (x,y,z);

x = X;
y = Height(X,Y);
z = Y;
glVertex3i (x,y,z);
}
end strip
}

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
if everything is ok except those lines you might want to think about this:

X <= Size; and x = X + Jump;
is this really a good idea?

Share this post


Link to post
Share on other sites

  • Advertisement