Jump to content
  • Advertisement
Sign in to follow this  

make triangle.

This topic is 4311 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 I know four corners of a quad in 3d,and some vertices on edge of the quad or in quad. how to make triangle list ,so I can map it and render it. the problem from here. I want to make a footprint on ground. I project quad to ground and get a quad on ground. so the question above occur.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Rasmadrak
google for "decals"...


yes, decals is what i need.
but I wanna decals on non-plat wall and ground.it seem too complex. someone give some links about that? google decals give more unuseful links hard to found them.

Share this post


Link to post
Share on other sites
I just implemented decals for my terrain engine yesterday. I simply calculated the rectangle of the decal as:

rect.left = Floor(x - size / 2)
rect.top = Floor(y - size / 2)
rect.right = Ceil(x + size / 2)
rect.bottom = Ceil(x + size / 2)

Then I extracted the points from the heightmap to build a trianglestrip quad. After that you'll have to make a texture matrix to offset the decal texture. The texture need to be clamped btw. - Render it blended!

Share this post


Link to post
Share on other sites
Quote:
Original post by DanielH
I just implemented decals for my terrain engine yesterday. I simply calculated the rectangle of the decal as:

rect.left = Floor(x - size / 2)
rect.top = Floor(y - size / 2)
rect.right = Ceil(x + size / 2)
rect.bottom = Ceil(x + size / 2)

Then I extracted the points from the heightmap to build a trianglestrip quad. After that you'll have to make a texture matrix to offset the decal texture. The texture need to be clamped btw. - Render it blended!


could you explain more detail? what does x,y mean? does it mean center of quad?
what does left top right bottom mean in rectangle?
does it mean :?

left top
|---------|
| |
| |
| |
|---------|
bottom right

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!