Creating a plane in between 2 points.
See original GitHub issueHi Again Guys,
This is not an issue with Three.js but rather a general query. I wish to draw a simple model I have stored as a set of 2d points (x1,y1),(x2,y2). Each pair of points represents a wall which I was drawing.
I was originally doing this by loading in an xml file and filling up an array of vertices which I then drew using a bit of code similar to this -
gl.bindBuffer(gl.ARRAY_BUFFER, walls3DVertexColorBuffer);
gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, walls3DVertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);
setMatrixUniforms();
gl.drawArrays(gl.TRIANGLES, 0, walls3DVertexPositionBuffer.numItems);
What would you guys recommend I do to draw the same scene in Three.js?
Is it advisable to create a large array of planes and assign each of these a position using my vertices? Or is there a faster way. I am also concerned about the normals and how the will appear with lighting etc…
All help is as always, much appreciated!
Kris.
Issue Analytics
- State:
- Created 12 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Defining a plane using only 2 points (and an axis)
Imagine you model this using table and a piece of paper. The axis along the table are X and Y and the axis...
Read more >Distance in the Coordinate Plane | College Algebra
Derived from the Pythagorean Theorem, the distance formula is used to find the distance between two points in the plane. The Pythagorean Theorem,...
Read more >plane equation from 2 points | Free Math Help Forum
Think of the paper as a plane. Now given two points in space place the pencil so that it passes through those two...
Read more >Fusion 360 Help | Create a plane through two edges | Autodesk
Create a plane through two edges · On the toolbar, select Construct > Plane Through Two Edges plane through two edges icon ....
Read more >How to Find the Distance Between 2 Points in the Plane
The values in the formula are found by the coordinates of the points given. Coordinate Pair: This is a method of denoting the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think this is the code you’re looking for:
https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_shapes.html