Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: Rotating an object along the vertex axis normal of another object.

  1. #1
    Newbie Newbie
    Join Date
    Oct 2014
    Posts
    1

    Rotating an object along the vertex axis normal of another object.

    Hi,

    I have 2 cubes[cube1, cube2] which are in their own local coordinate system. I want to rotate cube1 such that it is centered at a vertex of cube2 and rotating in the direction this vertex normal[of cube2].

    I have done something like this:
    1. Transform the vertex position of cube2 to world space.
    2. Transform the normal's axis at this vertex position to world space.
    3. Normalize this vector.
    4. Translate to the transformed vertex position.
    5. Rotate along this transformed axis.

    Is this right ? Any suggestions would be appreciated.

    Thanks.
    DarkCoder
    Last edited by darkcoder; 10-28-2014 at 09:06 PM.

Posting Permissions

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