Jump to content
Search Community

ThreeJs object ration on an angle

yan_rez test
Moderator Tag

Recommended Posts

How can I have an ThreeJS object rotate on an axis that is at angle.

 

Like from this codepen I made, the left square rotates on its center and moved up when you click on the "rotate up" button.

 

I want the left cure rotate along the red axis in the image attached and move along on that axis when click on the "Rotate 45 degree" button.  I can make up move along the axis, but the rotation is wrong. How can I make the cute rotate along the red axis?

 

 

Screen Shot 2021-05-06 at 4.29.42 PM.png

See the Pen MWpYggY by eforblue (@eforblue) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...