PDA

View Full Version : New script: Spirograph (final version page 2)



cameyo
12-12-05, 11:00 PM
Hi all,
i had some time last weekend to work with Z again...
I have write a small script to draw spirograph.
Do you remember this fantastic graphic tool ?
Spiro01.jpg
Spiro04.jpg
Spiro06.jpg

This is a wip (work in progress).
I'll add HELP, Examples, Save parameters...ecc.

Have a nice day.

cameyo

p.s. The final version will be post with complete source (as always)

marcus_civis
12-12-05, 11:15 PM
Hello cameyo, :)
This looks fun. I remember those things! Good to see you scripting again. :tu:
Cheers,

aminuts
12-12-05, 11:41 PM
wooo hoooooo!! A new Cameyo script!!

Looks like fun! gonna have to play me thinks!

welcome back!:D

sirquadalot
12-13-05, 05:15 AM
Good to hear from you again! You always amaze me with your scripts!:cool:

ZewbiBrusher
12-13-05, 01:16 PM
So much memories are flowing down my brain because of your script :)
say, will the result be in 3D or is it a 2D script?? What I mean by that is will it be editable? Like a tool.

Nice idea by the way.

DarthWayne
12-13-05, 02:09 PM
It would be interesting to use this to make 'spirographic' masks. (Is that a real word or did I just make it up?:o ) Imagine the fun with the meats wire technique and this :D :D :D :D

Wayne...

aminuts
12-13-05, 10:14 PM
wow this is loads of fun Cameyo! should have something to post soon as I load up on some coffee and thaw out.

one request for future version would be start and stop buttons.

Having said that....it's very easy to use and figure out what's what. I love trying out different alphas for different effects.....lot's of fun to be had.

Thanks!!!

cameyo
12-13-05, 11:24 PM
Thanks my friends!
Aminuts: the stop button is ESC :), i'm trying to find the number of steps...but i prefer to stop when i want.
DarthWaine: i don't understand what you want with the "spirograph mask", but i think you can do it. Please, tell me more.
ZewbiBrusher: the result is 2.5D; you can use 2d tools or 3d tools to draw the spirograph. I could add the mark routine to buid a multimarker object, but the number of objects are very high.
sirquadalot, aminuts, marcus_civis: thanks for your nice word. I post for people like you.

cameyo

Schbeurd
12-14-05, 01:22 PM
Hi Cameyo !

Thanks a lot man ! I already had a lot of fun with your Spirograph. Lots of possibilities with various tools, alphas and materials.

Simple idea, excellent script. Please continue to update it. :tu: :tu:

DarthWayne
12-14-05, 03:20 PM
Basically what I was one about (if I can get over what I mean), is to have the spirographic be ablke to be used as a mask over a part of a geometry. It would then be a simple matter for someone to inflate etc and create a difference mesh. I'm sure this would produce some spellbinding images.

Wayne...

aminuts
12-14-05, 10:07 PM
Darth....do your thing with spirograph , make sure you use a white material over black background (not absolutely necessary but makes for crisper alphas) then go to alpha menu and hit the grab doc button....you will now have an alpha of your spirograph that you can use as a mask or do make3d if ya like.

aminuts
12-15-05, 02:36 AM
when I get a second I'll pass along some of the settings I used.

SPIROFUN001.jpg (javascript:zb_insimg('23269','SPIROFUN001.jpg',1, 0))

cameyo
12-15-05, 06:19 AM
Aminuts: very good shapes.
I'm working to put the 'save' and 'load' buttons...but i don't have time now...

Please, post your result.

Thanks for share.

cameyo


p.s. frenchy: have you tried this script?

lemonnado
12-15-05, 07:56 AM
STOP posting cool stuff like this when I really have to work... sighhhh:lol:

spiro1.jpg (http://javascript%3Cb%3E%3C/b%3E:zb_insimg%28%2723288%27,%27spiro1.jpg%27,1,0% 29)

:tu::tu::tu:Lemo

PS:Could you make an option which limits the amount of steps. A little entry box would be cool. If empty it just performas as right now, if a value is in there it stops after the entered amount of angle iterations. That would be nice to have, so lugging nice alphas around with rather large angle steps does not require light speed reflexes to stop the script before it starts to overwrite existing 'drops'.

PS:If it is one stroke,would it be possible to keep, so a subsequent activation of ZiffWorms could 'add' to the experience??? I don;t know how the stroke buffer is maintained... Just a weird idea....spiro1cut.jpg (http://javascript%3Cb%3E%3C/b%3E:zb_insimg%28%2723292%27,%27spiro1cut.jpg%27,1 ,0%29)

Sebcesoir
12-15-05, 10:10 AM
Its nice but it draw badly slow on my computer.. Is there a setting to accelerate drawing?

DarthWayne
12-15-05, 10:43 AM
Yeah its a bit slow on mine...... ok more than a bit. :lol: I had time to go and make dinner, eat it, sterilise 12 bottles and watch futurama before it finished. While it would be nicer is it was faster I really like this plugin. I knocked something up with it after making an alpha from the spirographic image, (try saying that after a few drinks) and using it with extreme settings in projection master.

The tail of the whatever it is, is 90% spiroalpha, material is as you'll guess is one of Jantims new ones.

Wayne...

http://www.dashdotslash.net/images/3dmodels/brainfarts/probe2.jpg

aminuts
12-15-05, 11:24 AM
Try using smaller brush sizes, the flat material will also speed things up but then it's flat which is great for alphas.

I have found that some materials really slow it down but I reckon that due more to how zbrush renders than Cameyo's scripting abilities...some materials need more info...such as lights reflections etc.

try fast render instead of preview...you can always change it if you like it enuf to spend a few more minutes on it.

ummm i think I had another one but forget what it is.

lemonnado
12-15-05, 11:59 AM
Make bigger angle steps. That is the reason. It makes tooooooo many little steps. Try 1 as setting and then make it smaller if to coarse!

Lemo

TVeyes
12-15-05, 12:00 PM
Very cool script Cameyo :tu: Welcome back, Zscripting just seems strange without you and Digits around.

Svengali
12-15-05, 12:33 PM
Interesting potential in your newest invention, Cameyo!

Nice work, Nuts and Lemo - more, please.

Sven

yoogy
12-15-05, 02:36 PM
This script is cool -
playing with the script and Z-intensity and layers :D

Cameyoscript1.jpg (javascript:zb_insimg('23338','Cameyoscript1.jpg', 1,0))

Thx Cameyo

Sebcesoir
12-15-05, 03:10 PM
GREAT! Just increasing angles step size solve its... Thanks!! Irs great for comeplex geometric patterns!

cameyo
12-15-05, 11:02 PM
lemonnado: cool shape! ..and thanks for info :D


yoggy: post more !!! :eek:

DarthWayne: zbrush is endless...very good image;)


sebcesoir: you discover yourself the solution;)

TVeyes: thanks for your nice words, it's great to return here and meet with so many friends...:)

Svengali: when you post your next gem ?:tu:

Thanks to all.

I'm writing the 'Load' function, Help and maybe a pdf manual (...and the 'Step' slider) :cool:

cameyo

Bonecradle
12-17-05, 12:38 PM
Hey there, good to see you again Cameyo, and with a spiffy new zscript to boot - thank you very much :tu:

I've been playing with spirograph for an hour or so, trying (not very successfully) to get an intuitive handle on what will happen when you change sliders. I found this web page with a Java spirograph (http://www.math.dartmouth.edu/%7Edlittle/java/SpiroGraph/), which shows the circle diameters and pen positions before drawing the curves. It is useful for testing parameters before drawing in ZB as it is a bit faster.

One frustration with the manual spirograph (which I still have in a cupboard somewhere) was getting near the end of an intricate design and slipping with the pen. It seems my PC-ZB combo isn't without frustration too - when drawing a spirograph with a 3D tool, more often than not after a while ZB starts to make graphical glitches. I wonder if it is my old video card unable to keep up with the rendering, though it happens even when I set it to draw slowly. Does anyone else get graphical problems?

How exactly is the spirograph drawn, given that strokes in ZB have a finite length? Is each instance of a 3D tool in the spirograph on the canvas a different stroke? When drawing with e.g. a torus, the orientation of the torus on the canvas seems to be quite random - maybe there are settings in ZB to change this - I tried the various stroke, picker and draw settings to no avail, but it is a while now since I touched ZB and I have forgotten a fair bit.

A couple of suggestions that might help to control the design more would be the ability to (maybe impossible though - I have no idea if ZB works in degrees like this rather than just absolute pixol position):

-Set the start point at a determined angle with respect to the centre of the fixed circle

-Control/alter zdepth while drawing e.g. a slider to determine the zdepth range and a setting from 1-360 to determine how often the zdepth 'changes'. For example, say you have a 240 radius fixed circle with a 40 radius moving circle so you get a six 'pointed' design. If you then set the range and entered a value of 60 for how often the zdepth changed, the ends of the six 'points' would then be higher or lower in zdepth relative to the centre of the design. I guess this would require the sprirograph to start drawing exactly at either the closest or furthest point to the centre of the design.

Sorry if this sounds greedy - I'm not trying to be - just fantasizing a bit :)

Thanks again for the useful and fun zscript

Dave

cameyo
12-18-05, 10:59 PM
Hi Bonecradle,
you right...without the circles it's difficult to understand what will be :o
I have written a Delphi program before this script to play with spirograph. Maybe i'll post it tomorrow. ;) Anyway i don't have any problem using 3D tools.
Now the new version (definitive unless good hints or bugs:cool:). I post some info about your problems.

spiro.jpg

What is a Spirograph?
Spirograph is a shape formed by rolling a circle inside or outside of another circle.
The pen is placed at any point on the rolling circle.
If the radius of fixed circle is R, the radius of moving circle is r, and the offset of the pen point in the moving circle is O, then the equation of the resulting shape (curve) is defined by:
x = (R+r)*cos(t) - O*cos(((R+r)/r)*t)
y = (R+r)*sin(t) - O*sin(((R+r)/r)*t)
About this script
This script allow to create spirograph shapes. You must set the parameters and then press the 'DRAW' button.
You can use 2.5 tools or 3D tools; the script use the 'DragDot' stroke type to draw the shape. You can select alpha, texture and material.
You can save and load the parameters of spirograph shape (this function saves DrawSize, Tool, Alpha and Material too).
The Angle Step parameter affect the definition of the spirograph shapes and the time of drawing.
I suggest to use Flat material to draw and then apply any material to the shape. When using 3D tools use fixed depth (Picker->Selected Z) to draw all the shape with same depth (Z).
The process of drawing continues until you press 'ESC' (or after 9999999 iterations).
I hope you have fun with this script!

Please, post your spirograph and tell me some hints (121)

cameyo

Frenchy Pilou
12-19-05, 03:58 AM
Hi Cameyo
I have one many times ago like this follow :cool:
All plastic wheels or forms have some gears!
http://www.boardgamesrus.com/images/Spirograph%20G23.jpg
Testing your new crazzy script the next year :D
But I am sure that is a good one again! ;)
Spirograph is the perfect example of the "Cycloïds Curves" (http://steiner.math.nthu.edu.tw/disk3/gc-02/cycloids/);)
Top menu for me eyes closed :tu:
Pilou
Ps Not attracted for a Fractal script ? :rolleyes:

jvpt3
12-20-05, 11:31 AM
Very cool, thank you!

Craig Ward
12-23-05, 10:45 AM
Super-Duper-ZScript.!! BELOW = 1st go, 5 mins before having to go out. Can't wait to get back in and have a proper fiddle-de-de.

Sebcesoir
12-23-05, 12:37 PM
Simply great.. You can now save and load setting...

Absolutly great...

cameyo
01-02-06, 12:12 AM
Thank you all!!!

Here is the revision B...
Add Random Color and Palette Color.

A small challenge:
try to create the following tool with this script:
SpiroTool.jpg

Happy Year to all.

ciao

cameyo

aminuts
01-02-06, 12:33 AM
thanks Cameyo!!

can't wait to test it out and attempt your challenge there!


ps...was hoping for a way to add color while it was running.....woohoo!!

cameyo
01-04-06, 03:59 AM
anyone got the tool ???

cameyo

Frenchy Pilou
01-04-06, 05:49 AM
..the trick for decrease the size of an object or the brush :mad:

But it's a good idea for add this sort of parameter inside the script ! :cool:
An increase / decrease size will be terrific (Ping-Pong or progressive or cyclic ) !

Another thing, why not make this sort of fractal system?

xf = (R+r)*cos(t*x) - O*cos(((R+r)/r)*t*x)
yf = (R+r)*sin(t*y) - O*sin(((R+r)/r)*t*y)

x = (R+r)*cos(t*xf) - O*cos(((R+r)/r)*t*xf)
y = (R+r)*sin(t*yf) - O*sin(((R+r)/r)*t*yf)

etc ... some possibilities are possible :)
More funny than the simple trivial Original (http://www.wordsmith.org/~anu/java/spirograph.html) :D

Have funny scripting!
Pilou

aminuts
01-04-06, 07:35 AM
hi Cameyo,

haven't got it yet, but haven't had too much time to play since i downloaded it. i do plan on giving it the old college try when I get a minute tho!;)

cameyo
01-09-06, 01:44 AM
To build the tool you must select a 3Dsphere tool, run spirograph script with standard value.
You must let the script draw three or four complete revolution...then grab the canvas with MRGBZGrabber and use Alpha->Make 3D.
That's all.

ciao

cameyo