Closed skoch9 closed 5 years ago
Nothing obvious comes to mind (setting the .array
property should make this happen by default). Are there any error messages in the browser console (and which browser are you using / which version of pythreejs etc)?
For me to look into this any close, I would need to be able to debug this, meaning I would need a way to reproduce the problem. Do you have a (preferably) simple example that reliably reproduces this issue?
Thanks, while condensing down my example to a MWE I stumbled upon the source of the problem. The crucial part appears to be the initialization order of scene and renderer:
renderer = Renderer(camera=cam, scene = Scene(), controls=[orbit], width=200, height=200)
scene = Scene(children=[mesh, cam, light])
renderer.scene = scene
produces the shown problems when updating the mesh in the scene whereas the following works:
scene = Scene()
renderer = Renderer(camera=cam, scene = scene, controls=[orbit], width=200, height=200)
scene.children = [mesh, cam, light]
Thanks for your help!
Hmm. So basically you had two scene objects? I can see that this might have thrown the rendering logic off. Let me know if you find something else in addition :)
Yes, that has caused the update to work sometimes and sometimes not. No errors were output on the console.
Hi,
I am updating the vertex positions of a BufferedGeometry object with the following code and a slider widget:
This is sometimes working and sometimes requires to rotate the view (see attached example). I couldn't figure out what is needed to make it reliably work and there also seem to be differences between different browsers.
Some of the code above is just from experimenting and it would be helpful if you could quickly tell what is actually needed to reliably update vertex positions (and the rendering), as this would be a much better approach to animations for us (any maybe others)?
Thanks!