Agustin,
Only geometric objects (meaning models) can participate in collision detection via the
#collision modifier. Your ideas are right on the money though:
1. Make a sphere or box primitive model (use front faces only)
2. Make the camera a child of the box and put the camera inside the box
NOTE: if the camera is inside the box and you've made the box with front faces only
the box will not be visible through the camera. ;)
3. Add the collision modifier to the box.
Now move your box around the world instead of the camera and you'll have a collision
participating proxy for the camera and you'll get the effect desired. Sample code:
-- make a box primitive with front faces
mr = member("3D").newmodelresource("cam_box",#box,#front)
-- make a model using that resource
m = member("3D").newmodel("cam_box",mr)
-- make the camera a child of that box
m.addChild(sprite(1).camera)
-- put the camera at the same position and
-- orientation as the box
sprite(1).camera.transform.position = vector(0,0,0)
sprite(1).camera.transform.rotation = vector(0,0,0)
Done! Now, as I said you would move the model "cam_box" around the world and the
camera will come along for the ride, the box will be the collision geometry for the
camera. You will want to set the size of the box (its height, length and width) to
appropriate values for your needs though.
NOTE: because the camera becomes a child of the box, the transform.position and
transform.rotation of the camera are the position/rotation relative to the box and not
the world, that is why setting these properties to vector(0,0,0) puts the camera in
the same position and rotation as the box.
Ok, if that isn't enough to get you going check out the following resources:
<http://www.shockwavemovies.com>
check out the gallery, demos and scripts sections
<http://www.directoru.com>
click on Community Center then select 3D Resources
<http://www.director-online.com>
check out the latest articles section
Have fun,
Tom
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]