Skip to content

Conversation

@dmarcos
Copy link
Member

@dmarcos dmarcos commented Nov 21, 2017

No description provided.

@dmarcos dmarcos force-pushed the object3Dmanipulation branch from 846b01b to 5cf51b7 Compare November 21, 2017 01:41
var component = this.components[attr];
var component;
if (attr === 'position') { return this.object3D.position; }
if (attr === 'rotation') { return this.getRotation(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale as well

this.object3D.el = this;
this.object3DMap = {};
this.parentEl = null;
this.rotationEuler = new THREE.Euler();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used?

var radToDeg = THREE.Math.radToDeg;
var rotation = this.object3D.rotation;
var rotationObj = this.rotationObj;
rotationObj.x = radToDeg(rotation.x);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not too long to have written out, consider:

this.rotationObj.x = THREE.Math.degToRad(this.object3D.rotation.x);
this.rotationObj.y = THREE.Math.degToRad(this.object3D.rotation.y)
this.rotationObj.z = THREE.Math.degToRad(this.object3D.rotation.z)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think this is better as a private method outside the prototype:

getRotation (rotation, target)

@dmarcos dmarcos force-pushed the object3Dmanipulation branch from 5cf51b7 to 348431c Compare November 21, 2017 02:36
One can now edit the position and rotation of the object3D directly and
getAttribute and setAttribute will return consistent values.
@dmarcos dmarcos force-pushed the object3Dmanipulation branch from 348431c to 2341040 Compare November 21, 2017 02:44
@dmarcos
Copy link
Member Author

dmarcos commented Nov 21, 2017

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants