how to draw 2D spiral ?

max's icon

Hello list ,

i'm working on an multimedia project and I would like to draw a spiral (starting from the center ) on the ground .
not something amazing , just a simple thing in 2D .

how is the best way to realize that with Jitter (or maybe with the graphics objects of Max) ?

thanks by advance for your help !
have a nice day

Maxime

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

not jitter, but can be adapted,

metamax's icon

One way to think of a spiral is the path drawn by a clock hand that is changing in length. Check out the length() and smoothstep() operators in gen.

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

the jit.gl.path help file demonstrates one more technique and output format for making a spiral.

max's icon

Thanks for all your help !
just I can't find anything to make a spiral with jit.gl.path
also , in your patch Metamax , I missed a kind of gen objects jit.world . how I can find or compile it ?
sorry , i'm a kind of beginner in Jitter by the way .

thanks
Maxime

Roman Thilenius's icon

1. draw circle

2. constantly add an offset over time

lightspeed.johnny's icon

A spiral is a special case of a simple Lissajous Curve

As others have point out, what you want to do is modulate (change) the amplitude of your oscillator ( sin/cos periodic function) over time. If none of this makes sense, then you need to start reading the linked article on Lissajous curves and review your high-school trigonometry notes.

As Rob pointed out, the jit.gl.path help file is a good starting point. Here is another implementation using jit.gl.mesh (which also takes a matrix of points and draws them to the screen).

Max Patch
Copy patch and select New From Clipboard in Max.

matmat's icon

Hi,

Here a spiral with jit.gen & jit.gl.path

Max Patch
Copy patch and select New From Clipboard in Max.

max's icon

Thanks a lot for all your answers , that's help me a lot !
Just i'm on Max6 and apparently the Jit.world object doesn't exist . Can I replace that by something else ?

Thanks

matmat's icon

Yes for sure

Max Patch
Copy patch and select New From Clipboard in Max.

Pis Pas's icon

Yes, have a look at jit.gl.render!

max's icon

Thanks a lot for your answers !
All the patch are working , but in fact I would like this spiral built itself gradually , starting from the center on 60 seconds for exemple .

Sorry for all my questions . I'm quite fluent in Max/Msp but the logic of Jitter seems a bit more complicated for me .
Merci !

Rob Ramirez's icon

check out the jit.gl.path @evalin and @evalout attributes.