POV-Ray : Newsgroups : povray.binaries.images : Looking to the Sun : Re: Looking to the Sun Server Time
1 Aug 2024 04:11:38 EDT (-0400)
  Re: Looking to the Sun  
From: Edouard
Date: 20 Mar 2009 17:15:01
Message: <web.49c4071aaa0d6de0617fb3dd0@news.povray.org>
"sooperFoX" <bon### [at] gmailcom> wrote:
> But is there a way to read/parse the probemap.lm file directly into POV or do I
> have to convert them into lights by hand?

Very rough version:

#declare dome_size = 10000;

#macro LoadLightMapGenFile( filename, manual_rotation,lightscale )
 #fopen file filename read

 #local number_of_samples = 0;
 #read (file, number_of_samples)

 #local phi = 0.0;
 #local theta = 0.0;
 #local solid_angle = 0.0;
 #local r = 0.0;
 #local g = 0.0;
 #local b = 0.0;

 #local i = 0;
 #while( i < number_of_samples )
  #read (file, phi, theta, solid_angle, r, g, b )

        light_source {
            <0,0,10000>
            rgb< r, g, b > * 2 * lightscale
            area_light < sqrt(solid_angle * dome_size) * rtod, 0, 0 > < 0,
sqrt(solid_angle * dome_size) * rtod, 0 >, 2, 2
            circular orient jitter
            rotate x * (-90 + (phi * rtod))
            rotate y * theta * rtod
            rotate y* manual_rotation
        }

  #local i = i + 1;
 #end

 #fclose file
#end


And the modified lightgenmap file (using a quick search and replace):

16,
1.67289808803656, 0.68722339297277, 1.6527013386, 0.0552636348, 0.0607447550,
0.0508851111,
1.54723438189297, 1.66111711558560, 0.7794830194, 0.0711220279, 0.0557181686,
0.0360830873,
1.61792021659874, 2.17162592179394, 0.5545587558, 0.0781337619, 0.0515972860,
0.0299037341,
1.41764368493239, 2.17947990342792, 0.0867880323, 0.0761284605, 0.0559703335,
0.0377449766,
0.91891585117501, 0.61261056745001, 0.8644722987, 0.0400214680, 0.0603732206,
0.0936556607,
0.94247779607694, 1.50403748290611, 0.4497592365, 0.0661152080, 0.0552642494,
0.0537655167,
1.20558618081508, 2.10486707790516, 0.1601643115, 0.0730255991, 0.0542870797,
0.0431215167,
0.75005524604456, 2.10879406872215, 0.3450847009, 0.0759069920, 0.0534908585,
0.0404571854,
1.69253304212150, 3.01592894744620, 1.5993434847, 0.0655947104, 0.0591190495,
0.0349534899,
1.29983396042278, 2.95702408519139, 0.3214766435, 0.0631420985, 0.0567937195,
0.0538687669,
0.81681408993335, 2.68998870963626, 0.2905465791, 0.0762574896, 0.0534339696,
0.0398534238,
0.81288709911636, 3.29867228626928, 0.5453702181, 0.0694099888, 0.0545476936,
0.0498176217,
1.64540915231765, 4.60243323750905, 1.7470526871, 0.0568613783, 0.0604094379,
0.0494299829,
1.61792021659874, 5.72947960198439, 1.3599216939, 0.0526376031, 0.0615689270,
0.0575421639,
0.91891585117501, 4.45713457728052, 0.9250347179, 0.0431348681, 0.0603335723,
0.0894638970,
0.95033177771091, 5.67057473972958, 0.8845644490, 0.0372447670, 0.0613860562,
0.1000061333,


Cheers,
Edouard.


Post a reply to this message

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