Sign in to follow this  
BlackDragon777

Collision Detection problem

Recommended Posts

Hello Everyone. I have a question about scaling models. I am implementing collision in my 3d maze game. I orginally created all models the same size. The only models in my game are cubes (including the player) and fla plains for the floor and ceiling. All models have the same scaling when I modeled them. However I want the player to be smaller than the walls and floor. So I scaled the walls and floors by Vector3(5,5,5) From the bottom to the top of one floor plain mesh, it is 0 to 1. For example (0,1)__________(1,1) | | | | | | | | (0,0)----------(0,1) However the player is smaller than the floor mesh tile. I draw hundreds of floor mesh tiles to draw the level's floor if that makes since. When a player moves within a floor tile, he starts at (0,0) but when he gets to the top left corner, he is at (0,5) instead of (0,1) because I scaled the floor tiles and walls as I mentioned earlier. I want his x and y values to appear as (0,1) and not (0,5) so that collision will be easier to do. I made a ratio function that would convert the player's real position to a coordinate that would match that of the rest of the world. Unfortunately, using a ratio gets messy because it is a fraction and collision will not be very accurate in a very large maze. Any ideas on how I can make the world and player's position be in the same coordinate system? Thanks in advance! GOD Bless you Always!!!

Share this post


Link to post
Share on other sites
Quote:
Original post by BlackDragon777
I made a ratio function that would convert the player's real position to a coordinate that would match that of the rest of the world. Unfortunately, using a ratio gets messy because it is a fraction and collision will not be very accurate in a very large maze.


What makes you think this is going to be inaccurate? It sounds ok to me, the scale converter is going to be constant regardless of how big the map is.
Are your objects and player coordinates measured in Integers or something, and you dont want to involve floats in calculations?
I'm not seeing an issue here... maybe I don't get the whole picture

PS if you dont like fractions (ratio less that 1??) then why not invert it, use the other coordinate system, and do a multiply instead of divide.

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