metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG

Home Page:https://zzz.dog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

construct complex shapes and import wavefront obj files

gregja opened this issue · comments

Hi,
This issue... is not really an issue ;)
I created a github repository with some experiments I made with Zdog
https://github.com/gregja/zdogXperiments
In that repository, you'll find different techniques to create complex shapes in Zdog, and a function to import 3D objects (wavefront format). This function is largerly inspired by a similar function found in Phoria.js.
I'll add other experiments later.
I'm beginner with Zdog, so if you want to suggest me some improvements, don't hesitate ;)
Thank's

Thanks so much for sharing this. Very interesting to see Zdog used more like a normal 3D engine. I'm impressed it works at all.

Hi David,
You created a very flexible framework, so it's a big pleasure to experiment in different directions with it. Thank's a lot for your work.

Hi :)
on my repository of zdog experiments :
https://github.com/gregja/zdogXperiments
... I added a generator of parametric surfaces, with an interface drived by dat.gui.js (very interesting to do)
on the other examples of the same repository, I fixed a bug : when I was regenerating a shape, the size of the canvas was growing. To fix it, I don't regerenate the main object, I just clean the array of children attached to this main object, like that :
illo.children = []; // drop all children before regeneration
Maybe there's better to do... but it works fine.

Yeah, that's one way to do it. Another way would be to create a holder Anchor for each complex shape. When you create a new complex shape, you replace the holder Anchor.

That's good to know, I will use this technique in my next scripts. Thank's a lot David.

I programmed my first "Möbius ribbon", and I programmed it with Zdog.
You'll find it on the examples of "parametric surfaces" of my repo :
https://github.com/gregja/zdogXperiments
Zdog is really a great playground, thank's a lot @desandro .

Your repo is now linked under Extras - More Zdog resources