POV-Ray : Newsgroups : povray.binaries.images : placing books : Re: placing books Server Time
18 Aug 2024 04:15:51 EDT (-0400)
  Re: placing books  
From: JRG
Date: 11 Aug 2001 08:45:57
Message: <3b752905@news.povray.org>
No strange formula. Just a bit of trig. The right formulae much depend on
your approach to the problem. My macro begins from a rotation value which
depens on the book position in the shelf (the books on the right are more
tilted) and on a random amount. Then it finds the distance of the book from
the previous one. Which is of course based on the rotation of the last book,
but also on the sizes of the two books (which could be different). So you
have to split your macro in several cases, because the formulae can be very
different.
For istance, suppose that the new rotation value is greater than the
previous one (a very common situation) and that the two books have such a
size that the second one leans against the previous one (and not viceversa).
If you indicate dist=(x coordinate of the point of contact between the
previous book and the *floor*) then you have to translate the second book to
dist+x_size_of_last_book/sin(radians(last_book_rotation))+y_size_of_new_book
*sin(radians(last_book_rotation-new_book_rotation))/sin(radians(last_book_ro
tation)) along the X axis. Just make a sketch on a sheet and you'll see
that.

--
Jonathan.

"Peter Hertel" <NOS### [at] hertelno> ha scritto nel messaggio
news:3b74150a@news.povray.org...
> > I've just written a little macro to place books on a library (I needed
it
> > for my irtc entry). The first queue uses a little amount of randomness,
> the
> > second one uses no randomness. Well, not much to say, I just liked the
> > effect and wanted to share it with POV community :).
> > (Oh, well, in my irtc entry I'm using books instead of 60ies coloured
> > superellipsoids...)
> >
>
> I've always wondered how you do things like that :-)
> Is it something like
> bookrotation = lastbookrotation*(some strange formula) ?
>
> Peter
> http://hertel.no/peter
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.