Custome TransformControls that lets you add any arbitrary axis

custome transform Axis
I have extended the TransformControls functionality, which allows to add any defined axis. Defining the axis direction has become more convenient using a vector. Moreover, you can create multiple custom transfer axes using the method addCustomTransferAxes(axisDirList: Vector3). you can also add a single axis using addTransferAxis(axisDir: vector3)

interactive demo with code coming soon

Edit: Sorry for the delay. Unfortunately, i didnt got the chance to clean up the code so i thought i would just share what i got.

the most important part of the code is:

let axesDirList = [
  new THREE.Vector3(1, 1, 1), // Quadrant I
  new THREE.Vector3(-1, 1, 1), // Quadrant II
  new THREE.Vector3(-1, -1, 1), // Quadrant III
  new THREE.Vector3(1, -1, 1), // Quadrant IV
];
....
transformControl.addTransferAxesList(axesDirList);

2 Likes

Got a link?

where is it?

Does it allow rotation around arbitrary axis?

Does it allow scaling along arbitrary axis?

1 Like

Currently, it only allows transfering. But the concept can easily be appkied to rotation and scaling. I have only extended it just enough for a required task, but if i see enough interest here, i might add rotation and scaling

Excellent. Iā€™d love to see the implementation of scaling and rotation, as long as they have the potential to skew geometries like in the following illustration (it shows scaling along a diagonal axis so that a square becomes a rhomboid).

AFIK that is skewing and not scaling. scaling would just scale the object in proportion to the cosine of X,Y and Z of the axis you defined.

@trusktr @pecopeco @PavelBoytchev added a link check it out.

1 Like

you can technically do that but you need to turn matrix auto-updates off. since decomposing/recomposing will mess this up

box