Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the twist axis #5

Closed
dhoff002 opened this issue Jul 16, 2016 · 2 comments
Closed

Change the twist axis #5

dhoff002 opened this issue Jul 16, 2016 · 2 comments
Labels

Comments

@dhoff002
Copy link

How do I change the twist axis in three.js. Thank you so much for updating this. It is working great so far! I can only twist along one axis so far. Amazing work!

Dan

@foo123
Copy link
Owner

foo123 commented Jul 17, 2016

Twist modifier has a parameter vector with respect to which the twist is performed.
The default value is the Y axis ([0,1,0]) To twist to another axis e.g Z do sth like this:

var twist = new MOD3.Twist();
twist.vector = new MOD3.Vector3(0, 0, 1); // Z axis
// rest code

The relevant code part is here

Most 3D modifiers (from as3dmod) are very customizable, however some use only a fixed axis. Twist is customizable with respect to which axis to use

@foo123
Copy link
Owner

foo123 commented Jul 17, 2016

After further update the relevant code for the Twist modifier is this

Note that one can pass the twist vector in the initialisation of the modifier (it is part of the parameters and similar to other modifiers), although the example code given above will continue to work correctly as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants