Professional Web Applications Themes

Restrict Camera movement and collision - Macromedia Director 3D

I have a tunnel exported from 3ds max 8, with a camera that I have added behaviours to in Director MX 2004. I have buttons on the screen that act as the triggers to move the camera rotate left/ right/ up/ down, and move forwards and backwards. Is there an easy way of ensuring that the camera does not go through the tunnel walls (either in Max or Director)? I've been trying to interpret a collision modifier, but I'm not having any luck and I'm not sure if this is the right way to go. Also, can I restrict the ...

  1. #1

    Default Restrict Camera movement and collision

    I have a tunnel exported from 3ds max 8, with a camera that I have added
    behaviours to in Director MX 2004. I have buttons on the screen that act as the
    triggers to move the camera rotate left/ right/ up/ down, and move forwards and
    backwards.

    Is there an easy way of ensuring that the camera does not go through the
    tunnel walls (either in Max or Director)? I've been trying to interpret a
    collision modifier, but I'm not having any luck and I'm not sure if this is the
    right way to go.

    Also, can I restrict the camera from rotating a full 360 degrees? Maybe just
    90 degrees in each direction.

    Any help would be much appreciated.

    Nickname Guest

  2. #2

    Default Re: Restrict Camera movement and collision

    Collision detection (particularly in 3d) is almost always non-trivial, and the
    best method is largely dependant on specifically what form your 3d scene takes.

    What is your tunnel like? a straight cylinder? a cylinder along an arbitrary
    path? A hemi-cylinder? Does the camera 'float' along or is it supposed to be
    walking along?

    How about posting a link to what you have so far?

    - Ben


    duckets Guest

  3. #3

    Default Re: Restrict Camera movement and collision

    It's a basic straight cylinder that I've put an image map on to make it look
    like a pipe, there's a little bit of debris lying around in the tunnel (just as
    something to look at and zoom in on). I want to pretend that the camera is a
    scope.

    I have an image of the remote control to the right side of the stage, you can
    click on the buttons of the remote to trigger the movement of the scope
    (camera). There is an image of a screen on the left side of the stage where you
    can effectively see what the scope see's.

    I want the scope to move like a worm with a head-mounted camera (getting
    technical now!!!!), to only move around roughly 90 degrees in each direction.
    but at the moment, my scope (camera) can move 360 degrees in any direction and
    can zoom through the pipe (which I also want to prevent).

    Nickname Guest

  4. #4

    Default Re: Restrict Camera movement and collision

    Anyone? Pretty please? I'm not really having much joy!
    Nickname Guest

  5. #5

    Default Re: Restrict Camera movement and collision

    To be honest its still difficult to get an idea of what you want, and what you
    currently have. Perhaps you could upload a demo movie?

    How are you currently moving your camera?

    If you just want to move your camera in a straight line along the pipe, while
    allowing it to turn, you probably want to set the camera's transform position
    directly (rather than using 'translate', which will move the camera along its
    own axis), and setting the camera's transform rotation directly too.

    Eg: If your tube runs along the y axis, at x=0 and z=0, 'd' could be the
    distance along the tube to position the camera. You could gradually increase
    'd' to move the cam along, and alter 'r' by small amounts to look from side to
    side. Every frame you would need to update your camera's position and rotation,
    after adjusting the values by a small amount.

    camRef.transform.position = vector(0,d,0)
    camRef.transform.rotation = vector(0,r,0)

    hope this helps

    - Ben


    duckets Guest

  6. #6

    Default Re: Restrict Camera movement and collision

    Thanks for your response.

    I basically have a straight 3d tube and a camera. I want the camera to move
    like an endoscope, so you are looking inside the tube by swiveling the camera
    around (something like 240 degrees) and zoom in and out (which I have so far
    ted by moving forwards and backwards). The only physical movement will
    be the pivoting around a point (effectively the base of the endoscope), the
    camera itself does not move backwards and forwards.

    I also have 6 buttons to the right of the stage that control the movement of
    the camera (for left, right, up, down, zoom in and zoom out).

    So far I have been using the behaviours from the Diretor library to move
    around. But I can't seem to constrain the movement of the camera (at the moment
    the camera can move in all directions and fly through the tube, which I dont
    want).

    So ideally, I want to:

    a) set limits on how far the camera can swivel in any direction
    b) set limits to how far the camera can zoom in/out
    c) ensure that the camera does not collide/pass through the tube

    Is this ant clearer? I'm starting to confuse myself!!!!

    Nickname Guest

Similar Threads

  1. camera.get for an outdoor camera ( not a webcam )
    By dsdsdsdsd in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: September 5th, 03:44 PM
  2. Smooth camera movement
    By bgsBS in forum Macromedia Director 3D
    Replies: 1
    Last Post: July 22nd, 08:34 PM
  3. third person camera movement
    By Richard.B in forum Macromedia Director 3D
    Replies: 1
    Last Post: May 10th, 12:34 PM
  4. using mouse movement to dolly camera in/out
    By andrew in forum Macromedia Director 3D
    Replies: 0
    Last Post: August 13th, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139