Loading...
Logo
Processing Forum

Rendering Static Objects in 3D

in General Discussion  •  Other  •  1 year ago  
Hello.

There is this concept that I do not understand and I would like someone to enlighten me.

Let's say I want to create a large array of objects (i.e. ellipses) and send them automatically in random positions in a 3D space. The objects will remain in the same position, however I want the user to interact with this space using a camera (peasycam for example).

Do I have to send these objects to be rendered in the draw() function every frame, or is it possible to do this in the setup() function only once and then use only the camera to navigate in draw();

Please let me know, I am very curious about this!

Thanks!

Replies(1)

Since processing-2.0, there is such a thing as a retained shape which you can create in setup, and render in draw, by calling shape(object) where object is the retained shape (actually PShape3D object), Andreas explains it on his blog. I don't think there is any way that shape doesn't get called every time, however as it is stored as a VBO there is no performance hit (unless you need to change the object/objects). I have found a massive improvement in performance using retained shape (but still not quite as good as the old GLGraphics).