Skip to content
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

save/saveFrame with update method #29

Open
Renroujos opened this issue Aug 17, 2021 · 0 comments
Open

save/saveFrame with update method #29

Renroujos opened this issue Aug 17, 2021 · 0 comments

Comments

@Renroujos
Copy link

I am fairly new to both Processing and iGeo and for the life of me I cannot figured out how to take a simple screenshot of the canvas properly.

Take for instance the code below: I am creating a bunch of random points one by one on XY plane.
At each update iteration/duration I want to capture a screenshot to make a gif file afterward.
When I run the code, I will either get the "com.jogamp.opengl.GLException: GL-Error 0x502" or the generated screenshots will be all black with no objects in it.

I can, as a last resort, create a keyPressed function with the save/saveFrame method inside to capture screenshot on key press and that works, but it seems extremely counter intuitive. What am I doing wrong? What is the proper method to capture screenshot sequentially with iGeo?
I am using iGeo 0.9.4.1 and Processing 3.5.4 on Python mode.

the code:

add_library('igeo')

def setup():

size(480,360,IG.GL)
IG.bg(1)
IG.persTarget()
IG.duration(20)    
rPoint = RandPoint(0,200)

class RandPoint(IAgent):

points = []
frame = 0

def __init__(self, mm, mx):

    self.min = mm
    self.max = mx

def update(self):

    min = self.min
    max = self.max
    self.points.append(IPoint(IRand.get(min, max), IRand.get(min, max),0).clr(IRand.clr()))
    self.frame += 1
    print('add point number {}'.format(self.frame)) 
    save('ss'+str(self.frame)+'.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant