Sign in to follow this  
WarisSweet

Simple terrain collision and terrain texture smoothing

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this