• ### What is your GameDev Story?

#### Archived

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

# humm ... triangle strip problem

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

## 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 on other sites
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 on other sites

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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634089
• Total Posts
3015460
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!