Simple terrain collision and terrain texture smoothing

Started by
2 comments, last by WarisSweet 17 years, 11 months ago
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.
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.
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...
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.

This topic is closed to new replies.

Advertisement