Jump to content
  • Advertisement
Sign in to follow this  
WarisSweet

Simple terrain collision and terrain texture smoothing

This topic is 4437 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

I don’t suppose anyone could direct me to a simple tutorial for either of these? I've looked around, but I'm just not quite sure exactly what to look for. For the collision just need a basic bounding box on my dynamic models at the moment, but the terrain I can’t do that with because of its shape. I was thinking about just using a Ray and using the model as the origin and straight down as the direction and then simply placing the bottom of my model directly on top of whatever face the ray hits on the terrain... but there has to be a better way than that. Also, with the texture smoothing, it isn’t only limited to terrain, it seems like every program I see that renders textures smoothes them out so that when you zoom in they don’t look pixilated. Is this most commonly bilinear filtering? Sorry I'm still very new to this stuff and so I'm not even sure what questions I should be asking.

Share this post


Link to post
Share on other sites
Advertisement
Regarding filtering, yes, bilinear should be enough to make zooming in not look pixellated. Although things will look smeared.

Regarding collision, from your description I assume that you're trying to put the model on the terrain. In this case, since the terrain is, I assume, a grid, you can find the height at the location of the model, and put the model at that height.

Share this post


Link to post
Share on other sites
Thanks a ton for replying, at least I know for certain that bilinear filtering is what’s causing the effect I see so often. But about the terrain, what would be a good way of going about finding the height of the terrain at a certain location? Is there any kind of function in directx to get the Y cord using the X and Z cords? This is assuming that I wont always be able to use one of the vertices because the X and Z cords could be some random decimal number...

Share this post


Link to post
Share on other sites
I was going through the Ray tracing stuff that I used for selecting things with my mouse and it seems that I found that it returns a distance to collision value ^^. I think I have everything I need now, thanks for the help.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!