Forums > Jitter

forbid wall coordinates in a 3d maze

November 27, 2011 | 6:35 pm

Hi all, i just finished this patch in which i load a text file in the form of 0s and 1s and it creates a 3d world where 0 are empty spaces and 1 are walls.
The camera can go through with simple commands: forward, turn left, turn right.
Now i’m trying to forbid the camera to enter wall spaces, i thought of clipping the coordinates in proximity of such walls. Anyone has a better/easier way?
PATCH ATTACHED WITH EXAMPLE TEXT FILE, sometimes the text file must be reset a couple of times for some reason.
Cheers
A

Attachments:
  1. testmaze.txt

November 27, 2011 | 6:37 pm

Sorry i lost my internet connection and thought it did not upload, there is double posting now….


November 27, 2011 | 7:36 pm

this kind of thing is usually handled by a collision detection library.
fortunately, max 6 has such a library built in with the physics objects.

in addition to the collision detection, there are several new externals that will help you with this project:
jit.gl.camera
jit.gl.light
jit.gl.node
jit.anim.node
jit.anim.drive

i strongly recommend checking out max 6 and the aforementioned externals and physics objects.
i’ll be more than happy to assist in setting up the necessary physics objects to handle camera collision detection with the walls of your scene.


Viewing 3 posts - 1 through 3 (of 3 total)