How to set a Plane GridHelper ? how to have my gridHelper oriented by a plane define from points?

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

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);

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 :slight_smile:

How do I calculate the rotation I need for the gridHelper to be in the same orientation than the plane ?

For what this need doing calculate if we attach one object to another if it changes then both change ?

1 Like

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

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 ?

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.

From @prisoner849 are very many well structured examples also for the manipulation of geometries in the collection! :+1:

2 Likes

So do I :slight_smile:
Plus, redundant knowledge of geometry and trigonometry from school :sweat_smile: