How To Achieve 3d Object Rotation With Radius Javascript

Discussion in 'Buildbox 3.0' started by gauravdashora676, Nov 10, 2018.

  1. gauravdashora676

    gauravdashora676 Boxer

    Joined:
    Sep 25, 2015
    Messages:
    12
    Likes Received:
    2
    How to rotate a 3d object with a particular radius so that rotation form a circle. SetRotation is applicable to rotate the object with its axis. How to achieve this task.
     
  2. DanFarfan

    DanFarfan Avid Boxer

    Joined:
    Sep 22, 2018
    Messages:
    101
    Likes Received:
    42
    oh fun... that's a good one, but, as far as I know, it's not available.

    Revolve (not rotate).
     
  3. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    It really depends on exactly what you're trying to accomplish, which I'm not clear on from your description. One way to offset the rotation point is to change the origin of the object. You can do this in BB3 by going to the 3D model settings of your object and change the position settings. This alters the origin. Or, you can have more flexibility when you create the object in a 3D Modeling program, such as Blender, you can change the origin to where ever you like and that's where it will rotate. Such as put the origin a certain ways away from the object, and that's the point it will rotate around. I also made an object with a circle mesh at the diameter I wanted the rotation, with essentially no thickness, and then attached the object I wanted to rotate on the centerline of the circle's diameter, then rotated in BB3 at the center of the circle mesh which was invisible. Worked perfectly. Another way that a @Steddyman suggested to create an invisible object the diameter of what you want, then make the object you want to rotate a child of that invisible object.and rotate the parent. I hope one of those works for you.
     
    Last edited: Nov 11, 2018
  4. Steddyman

    Steddyman Boxer

    Joined:
    Sep 3, 2018
    Messages:
    51
    Likes Received:
    29
    I might have described that one a little poorly, so lets try that again. You need two objects:

    1. CentrePoint object. Can be invisible
    2. Rotating object. This has to be a child of the CentrePoint object.

    Then open the Rotating object graph and click on the 3D Node. Modify the Position so it is the correct distance away from the CentrePoint and in the correct plane.

    Finally attach a Rotate script to the CentrePoint and rotate it in the Axis perpendicular to the plane on what they are sitting.

    I have created the attached bbdoc which has a full project setup this way that you can download from here:
    https://www.dropbox.com/s/9joobnrt1ldqnd7/Rotator.bbdoc.zip?dl=0

    Here is a quick video of it in action:
     
    DanFarfan and LBPToo like this.

Share This Page