Professional Web Applications Themes

From axisangle to radians in 3d application. - Macromedia Director 3D

Hey Converting SW3D rotation values to a 3d application. RIght now I'm converting to radians from axisangle. But applied to object in 3d application (which is localrotation) the thing is rotated differently from the shockwave object. Any ideas how to convert the angles to localspace - if that is what I need to do :) Here's a picture. Not the best example shown but... When rotation get is more it shows more. http://walen.se/temp/rotate.jpg cheers...

  1. #1

    Default From axisangle to radians in 3d application.

    Hey
    Converting SW3D rotation values to a 3d application.
    RIght now I'm converting to radians from axisangle. But applied to object in
    3d application (which is localrotation) the thing is rotated differently from
    the shockwave object.
    Any ideas how to convert the angles to localspace - if that is what I need to
    do :)
    Here's a picture. Not the best example shown but... When rotation get is more
    it shows more.
    http://walen.se/temp/rotate.jpg


    cheers

    walfridson Guest

  2. #2

    Default Re: From axisangle to radians in 3d application.

    It looks to me as if you are dealing with different rotations in the top and
    bottom image. The axisAngle in the top image indicates which axis the cube has
    been rotated around from its rest position, and by how many degrees. The
    bottom image shows three rotations (H, P and B), not an axisAngle.

    Perhaps you would get the results you are expecting if you used the
    ..transform.rotation property of the cube model. This returns a vector
    containing 3 angles: rotation around the x-axis, rotation around the y-axis and
    rotation around the z-axis. All these angles are already in degrees.

    Note that, to get to the desired orientation, the rotations are applied in
    order: first around the x-axis, then around the y-axis and lastly around the
    z-axis. Also, there are an infinite number of ways to arrive at the final
    rotation, so two transforms with different .rotation values may in fact have
    the same orientation.

    openspark Guest

  3. #3

    Default Re: From axisangle to radians in 3d application.

    There is a known quirk in transforms that can lead to the figures you
    associated with Havok.

    If you rotate a transform around its y-axis by setting the rotation of the
    transform, you can end up with strange-looking rotations such as vector(-180,
    90, -180). Normally this occurs only when you set the rotation around the
    y-axis to a value between 90 and 270. One solution is to set the rotation of
    the transform to vector(0, 0, 0), then use the rotate() method to apply the
    rotation for you.

    Instead of...

    vTransform.rotation = vector(0, 180, 0)

    ... try this:

    vTransform.rotation = vector(0, 0, 0)
    vTransform.rotate(vector(0, 180, 0))


    openspark Guest

  4. #4

    Default Re: From axisangle to radians in 3d application.

    Thanks James
    Problem is I'm not doing any rotation in the code really, its a havok model.
    So I only output the transform.

    uploaded some videos to show better what I'm having trouble with
    There are in xvid, if that is a problem let me know.

    http://walen.se/temp/axisanglefix.avi
    axisangle, +180 on all channels and *-1 on heading.

    http://walen.se/temp/rawaxis.avi
    axisangle, straight to radians.

    http://walen.se/temp/rawrotation.avi
    rotation, straight to radians.

    thanks for your time!

    walfridson Guest

  5. #5

    Default Re: From axisangle to radians in 3d application.

    Alright, been able to recreate my problem in director by rotating a second
    object to my master's object axisangle.
    So I get a difference in the rotation between the two.
    Here's my director project, simple & clean. hopefully someone will take a look
    at it :)
    http://walen.se/temp/showme_com.dir rightclick and save

    cheers

    walfridson Guest

Similar Threads

  1. Replies: 0
    Last Post: August 9th, 11:33 AM
  2. Replies: 2
    Last Post: August 7th, 07:13 AM
  3. Replies: 0
    Last Post: August 4th, 09:08 PM
  4. Replies: 0
    Last Post: July 4th, 07:15 PM
  5. Replies: 0
    Last Post: July 3rd, 08:58 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