|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Mike Miller" <mil### [at] gmailcom> wrote:
>
> > Haha...now you got me thinking. :)
> > This basement could be the backdrop to lots of creepy concepts.
>
> I somehow knew you'd be inspired. :D
>
> > > Quaternions:
> > >
https://news.povray.org/povray.binaries.scene->files/thread/%3C3f81dba5%40news.povray.org%3E/
> >
> >
> > Thank you!... I've been looking for this. And if you pointed me to this earlier,
> > my apologies. I tried adding quaternion rotations to my Blender export utility
> > and got hung up on the 'convert to euler' math.
> >
> > I have a question and I'm sure it's been asked many time:
> > In run time, can you access/read the pixel values in a loaded bitmap?
>
> Yes Sir.
>
> In "functions.inc" you will find a macro as a wrapper for a function.
>
> #macro eval_pigment(pigm, vec)
> #local fn = function { pigment { pigm } }
> #local result = (fn(vec.x, vec.y, vec.z));
> result
> #end
>
> POV-Ray of course loads it into a unit square, and so you have to scale it, but
> that can be done with some extent calculations and scaling.
>
> My standard cut-n-paste code for that is:
>
> #declare Feet = 12;
> #declare XSize = 4*Feet;
> #declare ImageMap = pigment {image_map {png "AlphaMirror4.png" once} };
> #declare Resolution = max_extent (ImageMap);
> #declare Resolution = Resolution + <0, 0, 1>;
>
> #declare Photo1 =
> box {0, 1
> texture {
> ImageMap
> }
>
> translate <-0.5, -0.5, -0.5>
> scale Resolution2*(1/Resolution2.x)*XSize
> }
>
>
> If you need implementation code for eval_pigment, just let me know.
>
>
> - BW
Thank you so much! This is perfect.
I'll let you know if I need help on this once I review the macros. First
thoughts are maps for object placement or scatter restrictions.
You rock.
Post a reply to this message
|
|