POV-Ray : Newsgroups : povray.binaries.images : workbench9.png : Re: workbench9.png Server Time
3 Mar 2024 11:27:43 EST (-0500)
  Re: workbench9.png  
From: Mike Miller
Date: 19 Apr 2023 20:05:00
Message: <web.644080a4299a4b8459197626dabc9342@news.povray.org>
"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

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