b0g
December 6, 2021, 5:04pm
1
Hello,
I’m pretty new to Threejs and I need some help from the community,
I’m trying to create a PlaneGridHelper
I have a plane define by 3 points, and I want to show some GridHelper but oriented on the plane
I do not succed how can I do that :
Should-I create a specific class ? or is there a way to move the gridHelper and align it with the plane ?
Here a fiddle to show my problem : Edit fiddle - JSFiddle - Code Playground
Thank’s in advance
Lighty
December 6, 2021, 6:21pm
2
gridHelper.rotation.x = Math.PI * -.5;
gridHelper.rotation.z = 1.4;
Not sure if it’s the desired result
let gridHelper = new THREE.GridHelper(2, 10);
gridHelper.geometry.rotateX(Math.PI * 0.5);
planeHelper.add(gridHelper);
scene.add(planeHelper);
//scene.add(gridHelper);
b0g
December 8, 2021, 9:13am
4
This is almost that, but I’m looking for something related to the plane definition, because I want be able to set any plane from 3 points and have a grid on that plane
How do I calculate the rotation I need for the gridHelper to be in the same orientation than the plane ?
Lighty
December 8, 2021, 9:29am
5
For what this need doing calculate if we attach one object to another if it changes then both change ?
1 Like
b0g
December 8, 2021, 9:41am
6
Amazing !!
This is it you’re right, I didn’t know this was existing adding an object to another
Perfect thank’s
Another option, how to translate and orient a grid, having three points: Edit fiddle - JSFiddle - Code Playground
3 Likes
b0g
December 8, 2021, 10:19am
8
This is perfectly what I need thank’s.
Do you have some idea’s how to improve my skill about geometrical manipulation of objects in 3D space ?
How to learn how to do ?
hofk
December 8, 2021, 10:46am
9
b0g:
How to learn how to do ?
I always learn from good examples.
That’s why I started collecting the examples from the forum for myself over 4 years ago.
But since it would be selfish to keep them only for myself, I publish them regularly.
The answers to some questions contain some very interesting and instructive basic examples. These are difficult to find in the large number of questions on discourse.There are also good examples in resources and showcase.
Therefore I collected them and put them on one page, clearly arranged by time.
The collection may be a help for beginners.
UPDATE 2019
http://discourse.threejs.hofk.de/ is now redirected
to the safe side * discourse.threejs.hofk.de
UPDATE 202…
From @prisoner849 are very many well structured examples also for the manipulation of geometries in the collection!
2 Likes
So do I
Plus, redundant knowledge of geometry and trigonometry from school