Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js dirtyVertices doesn't work

I created a 12*12 plane in three.js, and I tried to edit it's verticles between 2 rendering, but it doesn't work.

I added this code, but nothing changed:

ground.geometry.dynamic = true;
ground.geometry.__dirtyVertices = true;
ground.geometry.computeCentroids();

Code here: http://jsfiddle.net/vpBEG/2/

Thanks in advance,

like image 617
Danny Fox Avatar asked Mar 25 '26 18:03

Danny Fox


2 Answers

You have to reset your flags after each render:

ground.geometry.verticesNeedUpdate = true;

See the update to your fiddle

like image 108
Neil Avatar answered Mar 28 '26 06:03

Neil


For Three.js r.49 you need to use

ground.geometry.verticesNeedUpdate = true;

See the wiki: https://github.com/mrdoob/three.js/wiki/Updates

like image 36
WestLangley Avatar answered Mar 28 '26 06:03

WestLangley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!