[Fluxus] another perspective on perspective

Kassen signal.automatique at gmail.com
Fri Feb 26 09:35:59 PST 2010


> I'm sure you've done this, but I had fun making lots of them:
>
>
I did. I have a set of functions that deals with that. Some notes on that
kind of thing; rotating and translating is ok for quick tests but for lots
of them you are way better off with (hsrndvec) and (maim) or you'll end up
with bunches of them in some spots. What's also cool is adding constructs
that hold a location and a radius and adding those to a list. Then you can
check for a point that you picked whether it isn't within the radius of a
thing that's already there and there will be no clipping. You do need to
calculate distances over the sphere surface for that. Oh and I have a
function to pick spots on the sphere within a certain range of a given
point. I use that for villages, forests and so on. My list also keeps track
of what kind of object a certain entry is. That's so that in the future I
could try to keep -say- factories (todo) away from -say- residential areas.
I didn't yet get into that. I did fix the issue that this example has where
larger buildings will have corners that are floating in the air already.

It's all done procedurally, and different every time. I didn't yet plug
these new houses into that (I still need to make the other roof types work
with the new system) but the way it's coded it should fit with what I
already did.

I could share the code for that stuff if anyone needs it. Some of those
things were major breakthroughs for me, but I'm refreshing on my highschool
3d math and learning Scheme. It's probably not of so much interest to list
members who will be experts in both. I plan on sharing the whole thing once
it's "done" and others will be able to run it or add stuff.

But yes, it's great fun. My first test for building on a sphere looked
roughly like your code (but without the "perspective") and one look at that
first test made me sure that spheres are the way to go. It's just too cute
to resist. That and it's amusing to face just how crazy living on a sphere
really is;
http://www.flickr.com/photos/41408203@N02/4388424662/

I mean; if you build a house with vertical walls then your attic will be
larger than the ground floor (in surface area) and the ceiling will be lower
at the centre, assuming you placed a flat ceiling on top of the walls.
That's clearly loony, but that's what our world is like. Just a little bit,
but it is.

Cheers,
Kas.



(define (random-house)
>    (with-state
>        (rotate (vector (* (rndf) 360) (* (rndf) 360) 0))
>         (translate (vector 0 0 (- diam .1)))
>         (let ((x (* (rndf) 2))
>              (y (* (rndf) 2))
>              (h (* 5 (rndf))))
>                (build-block  x y h)
>                (build-roof-duo x y .5 h (vector 1 0 0)))))
>
> (for ((i (in-range 0 100)))
>        (random-house))
>
> cheers,
>
> dave
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20100226/b37d61fe/attachment.html>


More information about the Fluxus mailing list