HackerPoet / PySpace

GLSL Fractal Ray Marcher in Python
MIT License
1.15k stars 147 forks source link

How do I create a new fractal? #6

Closed macmv closed 5 years ago

macmv commented 5 years ago

You have those 6 numbers in keyvars. How do I create a new fractal? I'm on linux, so I'm thinking some of the keybinds might not work, but I can change the values in keyvars. How do I compile a new fractal, without restarting the program? I saw some cool animations in the video, of fractals changing shape, and I wanted to re-create those. I know this isn't an issue, I just don't know how to comment.

HackerPoet commented 5 years ago

Replace parameters in the fractal with '0' through '5'. For instance:

obj.add(FoldRotateX('0'))

'v' is also shorthand for ('3','4','5') like so:

obj.add(FoldScaleTranslate('0', 'v'))
Mangaclub commented 5 years ago

i duunno that doest make much sense to me. wouldnt it be keyvars[0] instead? obj.add(FoldScaleTranslate(1.5, (-1.0,-0.5,-0.2))) goes then as obj.add(FoldScaleTranslate(keyvars[0], (keyvars[1],keyvars[2],keyvars[3])))

2SidedPolygon commented 5 years ago

I'd also note that you don't necessarily have to use the keyvars at all--those are just what you need to use if you want fractals that you can update in real time. You can just put numbers like so:

obj.add(FoldScaleTranslate(2, (-3, 1, 0)))

I'm no programmer, but by messing around with it I've been able to make fractals using this method. However, while I have also been able to make fractals with the keyvars, I have not been able to get them to update in realtime for whatever reason (Though I downloaded this a while back, so maybe that's been fixed?).

HackerPoet commented 5 years ago

@Mangaclub That will make the value fixed on initialization. If you want to change them real-time you have to use the string notations '0' through '5' (and also 'v' as I mentioned above)