question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modify vertex-positions of Plane?

See original GitHub issue

Hello, I’m new to Three.js and started playing around with the demos. I’ve tried to modify the positions of my plane like this:

var oGeo = new THREE.PlaneGeometry( 1, 1, 1, 1 );

oGeo.vertices[0].position.z =  -0.5;
oGeo.vertices[0].position.y =  0.2;

That worked for the positioning, but I think my light won’t get applied on this plane like it should. There has to be a proper way doing this. Can you help me, please?

What I’m actually trying to do is a tilemap with 16x16 planes. I want to be able to modify the y-position of every plane dynamically.

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:25 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matthozcommented, Dec 27, 2011

I’ve added those two lines:

this.oGeo.computeVertexNormals();
this.oGeo.computeFaceNormals();
//...(old)
this.oGeo.__dirtyVertices = true;
this.oGeo.__dirtyNormals = true;

Now the light seems to be correct. Now I can realize my real-time-modification of those planes. But it really is a very dirty solution, isn’t it? Is this the only way to realize real-time modification of Objects? I know that it is possible to do this directly on the shader, but for the start, this is to high for me. Any other hints?

Btw. Thank you very much fabricasapiens

0reactions
chydecommented, May 28, 2015

@murci thank you SO much for the heads up about verticesNeedUpdate

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manipulating a vertex on a plane - Unity Answers
you need to access the vertices through the Mesh function this way. function Update () {; var mesh : Mesh = GetComponent(MeshFilter).mesh; ...
Read more >
Change vertex positions on a plane by customizing the ...
I would like to animate the vertex positions on a plane, using a meshStandardMaterial in order to benefit from it's built-in PBR features....
Read more >
Three.js what is the most performant way of changing a vertex ...
The best way in terms of performance is to update the positions in the vertex shader. This is because your geometry's position attribute...
Read more >
Using geometry nodes, is it possible to transform vertices, that ...
As of Blender 3.0 the Attribute Vector Math node is legacy. And there is now a much simpler way to transform vertices by...
Read more >
Positions Editor window | Package Manager UI website
Use the Positions Editor window to enter specific translation coordinates to modify vertex positions. ... Tip: You can access this tool from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found