jit.gl.sketch and 'squary' circles

Mar 25, 2009 at 7:47pm

jit.gl.sketch and 'squary' circles

Hi all,

i am trying to draw circles in jit.gl.sketch but the circles seem to be a bit ‘squared’; you clearly see that is consists of multiple polygons instead of being a real circle (see image below, ignore the fact that is is not anti-aliased, that is because this shot was taken on my macbook, but can still see it)

I actually want to draw an inverse circle: So fill the entire sketch with black except leave the circle transparent, right now i am just drawing a big torus with the lighting turned off to achieve this, is there a better way? Like cutting out a circle of a rectangle.

http://dump.sylvain.nl/random/squarycircle.png

#43018
Mar 25, 2009 at 7:53pm

why not create a circle texture in photoshop with an alpha channel?

#154160
Mar 25, 2009 at 8:06pm

The rest is also in jit.gl and the texture would have to be very large because the ‘cut-out’ circle should be able to scale from very little to very large while the rest still covers the entire window.

#154161
Mar 26, 2009 at 12:05am

i think your looking for upping @shapeslice see the help on usage

#154162
Mar 26, 2009 at 6:58am

Never mind the bit below, i did it in the wrong order :S

But to my second question: is there an easy way to draw a plane with the (adjustable) center cut out?

(stupid me)Looking at the help i see that i can change it, but it doesn’t seem to change anything. I tried some different values. Also in de jit.gl.sketch help-patch the shapeslice button icw a circle doesn’t seem to make it better formed.(/stupid me)

#154163
Mar 26, 2009 at 3:57pm

this might help:

gllinewidth 20,
framequad 1 1 0 1 -1 0 -1 -1 0 -1 1 0,
gllinewidth 1

The last message is to reset the linewidth to its default value for any other drawing messages that might follow.

#154164
Mar 26, 2009 at 6:56pm

IMO, the best option for this is to use a simple shader, since it gives you the ability to scale and feather the mask without risking resolution or geometry issues. There is a “spotmask” shader included with Recipe 38: BrightLights:
http://cycling74.com/story/2006/2/17/153427/406

Simply pass your texture through a slab with that shader loaded to generate a circular alpha mask for your texture. You might also find the shaders in the jit-shaders/transition folder useful as well.

Best,
Andrew B.

#154165

You must be logged in to reply to this topic.