Original Post
🔒 Locked
Quad rendering
Advertisement
Thanks,
I am setting each y-value in vertex to a new value, one from the height map i.e.I have a height map of 32x32 so I am drawing 32 triangle strips, still not getting desired result, it seems some of my triangles are getting culled because they must be binding wrong way due to value getting back from height map ?
I am setting each y-value in vertex to a new value, one from the height map i.e.I have a height map of 32x32 so I am drawing 32 triangle strips, still not getting desired result, it seems some of my triangles are getting culled because they must be binding wrong way due to value getting back from height map ?
Are you finding that alternate triangles are being rendered with backface culling on - if so, its what I mentioned in my post that you ignored on your other thread. You have the winding wrong. i.e. The order of the verticies is incorrect for a strip.
You can test this by moving the camera under the strip and seeing if the missing tri''s appear.
Sorry DanH didn''t mean to ignore the message you posted, I much appreciate your comments.
I''m just rendering from what I believe to be correct, again I will re-iterate the code I am using:
for(int z=0; z<32; z++) // 1024 is height size
{
for (int x=0; x<32; x++)
{
quadVertices[z][x].x = (float)x;
quadVertices[z][x].z = (float)z;// * ScaleZ;
quadVertices[z][x].y = GetHeight(z,x) / 8;
quadVertices[z][x].DiffuseColor = D3DCOLOR_XRGB(0,255,0);
}
}
The z is incremented for each new strip, I''m drawing 32 in all. The GetHeight function returns a height value from the height map.
I then render this as follows:
for(int i=0; i<32; i++)
{
g_pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, i*32, 29);
}
Maybe I should try using a triangle list first ?
Best regards,
Steve
I''m just rendering from what I believe to be correct, again I will re-iterate the code I am using:
for(int z=0; z<32; z++) // 1024 is height size
{
for (int x=0; x<32; x++)
{
quadVertices[z][x].x = (float)x;
quadVertices[z][x].z = (float)z;// * ScaleZ;
quadVertices[z][x].y = GetHeight(z,x) / 8;
quadVertices[z][x].DiffuseColor = D3DCOLOR_XRGB(0,255,0);
}
}
The z is incremented for each new strip, I''m drawing 32 in all. The GetHeight function returns a height value from the height map.
I then render this as follows:
for(int i=0; i<32; i++)
{
g_pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, i*32, 29);
}
Maybe I should try using a triangle list first ?
Best regards,
Steve
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement