POV-Ray : Newsgroups : povray.general : vrotate? : Re: vrotate? Server Time
30 Jul 2024 10:18:55 EDT (-0400)
  Re: vrotate?  
From: clipka
Date: 5 Mar 2009 10:10:01
Message: <web.49afeafeed80e874f567c3de0@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> This works well, and I've tested the output with cyls, which give the effect
> that I want, with the obvious exception that cyls make *terrible* moss.
> Since I'm dealing with a moss object generated from a macro that
> approximates Campylopus sp., which is obviously more complicated than a cyl,
> I need to find a meaningful way to rotate the individual models according to
> the surface normal to acheive any kind of meaningful effect.

Ah, I see.

So what you're looking for is the B in object{O rotate B} so that whatever was
vertically in O is now parallel to a vector N (your normal).

Or, the transformation matrix M in object{O transform M} to get the same effect.

Try this:

  #include "transforms.inc"
  ...
  #declare M = Reorient_Trans(y, MyNormal)
  object{MyCampylopusSp transform { M } }

For better effect, you may want to use:

  object{
    MyCampylopusSp
    rotate y*rand(MyRand)*360
    transform { M }
  }

AFAIK this should do exactly the thing you want. I guess there's a clever
combination of V* macros that will give you the proper B for a "rotate B", but
nothing as easy and elegant as the Reorient_Trans macro.


Post a reply to this message

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