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 pivot point of my object? #1364
Comments
You have two options. Offset all the vertices in your geometry: geometry.applyMatrix( new THREE.Matrix4().setTranslation( 0, 10, 0 ) ); Create a object that will act as pivot: mesh.position.y = 10;
var pivot = new THREE.Object3D();
pivot.add( mesh );
scene.add( pivot ); |
is there any pros or cons in those two methods? |
geometry.applyMatrix( new THREE.Matrix4().setTranslation( 0, 10, 0 ) ); is now geometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, 10, 0 ) ); |
the applyMatrix makeTranslation thing, doesnt work in my case. dont know why.
instead of:
|
Thanks @placegraphichere, that helped. |
Something like this should work as well with three.js v78, if you wanted to eg. rotate around your objects edge instead if its center: mesh.geometry.translate( -myObjectWidth/2, 0, 0 ); |
But be aware that using |
I want to translate my mesh (3d box container) origin from center to left bottom corner. So when I will add any other small mesh box inside the container mesh, it should gets placed inside the left bottom corner instead of placing at center. mesh.geometry.translate( -myObjectWidth/2, 0, 0 ); When I am using this, my mesh position is also getting changed |
I'm very new in this area, so excuse if it's a stupid question.
My problem:
I want to build a prism (polygon consits of 24 planes). So I have 24 planes, everyone of them is 15° degreed of each other and grouped. Because it is to complicated to calculate how much the x and z distance is, it would be easier if you set the pivot point in the bottom right for example? right? but how? or is there another possibility to create a circle which consists of planes?
sorry for my bad english :-/
The text was updated successfully, but these errors were encountered: