Hi
I’m trying to make Kaleidscope on iPhone. I found that textureScreenGrab example and would like to make triangle shape to make Kaleidscope. How do you make triangle shape?
I tried to bind texture, but it shows this error (class MSA::Shape3D’ has no member named ‘bind’) and I don’t know how to bind texture to triangle…sorry I’m still new to opengl…
Pseudocode off the top of my head (ie not tested):
setup:
ofTexture *tex = new ofTexture
tex->allocate(enough mem for screen capture)
MSA::Shape3d *shape = new MSA::Shape3d
shape->allocate(enough mem for vertices)
draw:
[draw your stuff to screen]
tex->loadScreenData(...)
shape->begin(GL_TRI_FAN)
// origin
shape->SetTexCoord(u,v)
shape->AddVertex(x,y)
// point 1
shape->SetTexCoord(u,v)
shape->AddVertex(x,y)
// point 2
shape->SetTexCoord(u,v)
shape->AddVertex(x,y)
tex->bind()
shape->end() <- this calls the actual draw
tex->unbind()
Don’t forget to delete your shape and tex on exit!