Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default RE-rotate

    Hi, all
    I have a scene include only one cast member called "cube" and this cast member
    include model called "red", all my need to do is "when I click button ...

    if model "red" in position (50,0,0) rotate it 180 degree around (0,0,0) world
    point.

    when I click again same button do that..

    if model "red" in position (-50,0,0) rotate it 90 degree around (0,0,0) world
    point.

    I tried next code, but not give me right result..

    on mouseup me
    if member("cube").model("red").transform.position = vector(50,0,0) then
    member("cube").model("red").rotate(0,0,180,#world)
    end if
    if member("cube").model("red").transform.position = vector(-50,0,0) then
    member("cube").model("red").rotate(0,0,90,#world)
    end if
    end

    I need know where my wrong in my code!!

    newmfa


    newmfa Guest

  2. Similar Questions and Discussions

    1. 3d rotate
      Is there a way or some software that will allow me to rotate an image forward, like it is on an axis that is paralell to the ground? I am trying...
    2. Rotate Tool Won't Rotate
      I'm sure this is a simple thing, but I'm blind on it. I've got Freehand MX running on Panther. When I select an object, click the rotate tool and try...
    3. CCW Rotate and 180 rotate in PS CS are not working properly
      I have installed the singel version of Photoshop CS on a G4 under Panther and a newly purchased G5 using Panther. When a bitmap file is created (i.e....
    4. Rotate Image
      Hi, I'd like to know how to rotate an image A and then, with copyPixels, insert it into image B, is this possible? If you have any...
    5. Help on Rotate in 3D
      I'm trying to get the camera to move and rotate to a set position over a number of keyframes. It does this when the mouse is run over another sprite....
  3. #2

    Default Re: RE-rotate

    Check it out: [url]http://robotduck.com/misc/rgb[/url]

    Is this what you're after?

    (this movie is adapted from one that the original poster posted to the doug
    forums)

    This is what I've done:

    * Reduced your sprites down to one frame, and put a 'loop' behaviour on that
    frame.

    * Used a general-purpose 'sendallsprites' behaviour on the 3 buttons, so each
    button sends a call for the handler "changeColor", each with its own colour
    name as the argument sent to that handler.

    * Put a behaviour on the 3d scene (called 'world bhv'), which creates a group
    and sets it as the cube's parents. This way, you can rotate the group and the
    cubes rotate with it. This is called 'rotate pivot'.

    * The 'changeColor' handler (in the world behaviour) sets a value called
    "rotateDestination" based on what color name is received as the argument. This
    is the angle to which the rotate pivot must turn to.

    * Each frame, it checks whether the current angle of the rotate pivot ('r')
    needs to be adjusted, to move towards the rotateDestination value. If so, it
    increases or decreases the 'r' value by a small amount until it reaches the
    rotateDestination value.

    Hope this is all clear! (source code is linked at the page above)

    - Ben



    duckets Guest

  4. #3

    Default Re: RE-rotate

    tip:
    what if if member("cube").model("red").transform.position = vector(50.0001,0,0)?
    ensamblador Guest

Posting Permissions

  • You may not post new threads
  • You may 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