jit.gl.sketch and 'squary' circles

sylvain's icon

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.

Rob Ramirez's icon

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

sylvain's icon

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.

yair reshef's icon

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

sylvain's icon

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)

Peter Nyboer's icon

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.

Andrew Benson's icon

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:https://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.