Hello, this is my first post on here, so I hope I’m following the guidelines correctly.
I want to orbit around an array of simple extrusions obtained through the extruder library. The code works in theory, but orbiting with PeasyCam is super slow. Is there a more efficient way of doing this? Do the shapes have to be recalculated each time draw() updates the geometry or is there a way to store them somewhere?
Thank you
add_library('extruder')
add_library('peasycam')
def setup():
size(800, 800, P3D)
background(255)
cam = PeasyCam(this, 2000)
cam.setMinimumDistance(100)
cam.setMaximumDistance(1000)
cam.lookAt(0,0,0,500)
circleList = []
def draw():
e = extruder(this)
background(255)
for i in range(10):
for j in range(10):
circle = createShape(ELLIPSE, i*10,j*10,20,20)
circleList.append(circle)
for i in circleList:
cylinder = e.extrude(i,100, "box")
shape(cylinder[0])
After reading your code properly, I think this is the slow part:
for i in circleList:
cylinder = e.extrude(i,100, "box")
What is it that you try to achieve axactly?
It seems that you want a cube of circle growing more and more right?
If this is the case, what you can do is start with the shape you want. And instead of extruding it at every frame, you can just translate the back part of the shape.