Professional Web Applications Themes

addModifier method - Macromedia Director 3D

I'm at a junction in learning Director and Javascript Syntax. I have finally managed to import 3D objects and move them in the 3D world. Now I would like to check for collisions by adding the collision modifier. However, after doing model.addModifier(...): 1. My model becomes immovable 2. the collision property of the model comes up undefined-which means all other dependent properties are useless. Can anyone tell me how to do this using Javascript Syntax, Please? I'm really stuck.:brokenheart;...

  1. #1

    Default addModifier method

    I'm at a junction in learning Director and Javascript Syntax. I have finally
    managed to import 3D objects and move them in the 3D world.

    Now I would like to check for collisions by adding the collision modifier.

    However, after doing

    model.addModifier(...):
    1. My model becomes immovable
    2. the collision property of the model comes up undefined-which means all
    other dependent properties are useless.

    Can anyone tell me how to do this using Javascript Syntax, Please?
    I'm really stuck.:brokenheart;

    Sharkmenace Guest

  2. #2

    Default Re: addModifier method

    sounds like your problem may be that models by default use their bounding
    spheres to determine collisions. if the models are close together their
    bounding spheres may collide before the meshes themselves causeing a cesation
    of forward movement.

    here's how to add the modifier to the model "myModel" in the 3d cast member
    "w3d" assuming myModel is the first model in the world:

    var myModel = member("w3d").getPropRef("model",1);
    myModel.addModifier(symbol("collision"));

    here's how to acces the modifier's properties:

    member("ddd").getPropRef("model",1).getPropRef("co llision");

    for instance to write the collision mode to the message window use:

    trace(member("ddd").getPropRef("model",1).getPropR ef("collision").mode);

    by default that'll be //#shpere

    to change a property, like the collision mode, use

    member("ddd").getPropRef("model",1).getPropRef("co llision").mode =
    symbol("mesh");

    now trace(member("ddd").getPropRef("model",1).getPropR ef("collision").mode);
    will be //#mesh

    Ex Guest

  3. #3

    Default Re: addModifier method

    Thanks, X
    I didn't think of using getPropRef() for each dimension of properties. I
    actually just broke down and learned lingo :D
    And yes the problems with the models being stuck was in fact resolved by using
    #mesh detection.

    I actualy had one model set to mesh and the other was the default, #sphere. It
    turns out I had to make them both #mesh.

    But as I said before, I have embraced Lingo.
    Thanks again.

    Sharkmenace Guest

Similar Threads

  1. Replies: 2
    Last Post: March 15th, 09:59 AM
  2. addModifier(#meshDeform) vertexlist delay
    By pcipher webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 0
    Last Post: November 29th, 01:00 AM
  3. method name exists, property value exists, calling method fails
    By Phil Powell in forum PHP Development
    Replies: 0
    Last Post: October 27th, 07:34 PM
  4. become: method
    By Pierre Jacoboni in forum Ruby
    Replies: 1
    Last Post: October 21st, 12:36 PM
  5. method versus method!
    By Fred Werne in forum Ruby
    Replies: 2
    Last Post: October 15th, 04:19 AM

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