-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vertices need update not working - r72 #7179
Comments
Do you mind creating a working jsfiddle that we can work with? |
Here you go: (in the JS settings of codepen, you can change the target THREE.JS build) Thanks! |
@NicolasRannou You are creating a new array of vertices each frame. That is not a very good practice. Instead, use @mrdoob The problem is that he is creating a new array of vertices each frame and Maybe we are going to have to make |
@WestLangley Thanks - just calling "set" on every single vertex of the vertices array seems to work. r72 (working): http://codepen.io/nicolasrannou/pen/zvqyrj |
Uhm... but I think it should still work...? |
@mrdoob I believe the problem is here: https://github.com/mrdoob/three.js/blob/dev/src/core/BufferGeometry.js#L368
|
Any news on this ? I have the same problem here. |
@tforgione Replace vertex values, do not reassign them. |
Replacing vertex values whould make me change a lot of stuff, I just wanted to know if there will be a fix soon, or if I should stay with the r71. |
@tforgione How this will be resolved has not been decided. But it will not occur until r.73. |
Ok, thanks for the information ! |
uvsNeedUpdate flag does not work in r72. Probably it is related to this bug. Simple example of the problem: |
Try adding this code block to if ( geometry.uvsNeedUpdate ) {
var attribute = this.attributes.uv;
if ( attribute !== undefined ) {
attribute.copyVector2sArray( geometry.uvs );
attribute.needsUpdate = true;
}
geometry.uvsNeedUpdate = false;
} three.js r.72 master The |
@dimarudol fixed. Thanks @WestLangley! |
@mrdoob I'm thinking the uv fix should go in master, too.... Hmmm. Maybe it is time to begin a new release renumbering: |
It's not a super critical bug... r73 will be out in two weeks anyway 😊 |
OK, well we still have the main issue of this bug report: you can't reassign the vertices array after the first render. |
Seems like a workaround is to do |
@mrdoob When I deleted geometry.__directGeometry,the geometry did update,but the rendering performance dropped down,is there a better way to make the geometry update? |
Could this problem occur with r75 ? |
@jniac If you believe you have identified a bug, please see "How to report a bug" in the guidelines. |
well, maybe i should, i'm quite a noob on github, i dare not open a new discussion if i do understand |
@jniac Please read my comments above. Change UV values using |
Thank you ! here is the JSFiddle using Vector2.copy : |
Thank you so much @WestLangley! It took me nearly all day to identify the fact that this was cursing me, but I'm glad to see your fix. |
If the decision is to not support the reassignment of any attribute, and require |
@WestLangley If your last statement is the intended direction, would it be possible to update the documentation on threejs.org? The section on How to update things reads:
There should be some note there that one can use For those accustomed to older Three.js versions, it might be helpful to add an optional warning that springs if one attempts to mutate one of these values directly. The warning could be disabled in the constructor for those who don't need them--that would be very helpful to those who would otherwise end up here or reconsulting the docs or migration guide... |
Is this open issue still not fixed? |
@zwcloud can you share the code that is causing you problems? |
I vote to consider reassignment as an invalid operation and close the issue. |
With r71 I could update vertices of my BoxGeometry for as below:
It doesn't work anymore on r72.
It doesn't raise any error.
Is it supposed to work? If not, which is the current best practice to update vertices of a geometry?
The text was updated successfully, but these errors were encountered: