POV-Ray : Newsgroups : povray.general : Cone math for spotlight Server Time
8 Aug 2024 06:20:10 EDT (-0400)
  Cone math for spotlight (Message 1 to 2 of 2)  
From: MPunk3
Subject: Cone math for spotlight
Date: 16 Mar 2001 14:26:15
Message: <3ab268d7@news.povray.org>
I sometimes have difficulty visualizing exactly what a spotlight will do.

Does anybody have (or feel like writing) a macro which would generate a
couple of cones using the parameters which copied the planned spotlight's
location, look_at, radius, and falloff settings?

I used an extremely crude one I wrote which required me to do start at
location 0,0,0 with look_at 0,0,1 then rotate and translate, but it would be
very cool if somebody did something a lot more generic.

It would be really cool if the POV spotlight did this for you... imagine a
keyword "test" that drew lines deliniating the edges of each cone, or even
test followed by a float, which could specify the distance at which to draw
circles, essentially the cone base (I'm thinking of the very intuitive
display in 3DSMAX for manipulating spotlights).


Post a reply to this message

From: Margus Ramst
Subject: Re: Cone math for spotlight
Date: 18 Mar 2001 15:32:14
Message: <3ab51b4e@news.povray.org>
"MPunk3" <zer### [at] yahoocom> wrote:

> Does anybody have (or feel like writing) a macro which would generate a
> couple of cones using the parameters which copied the planned spotlight's
> location, look_at, radius, and falloff settings?

How about this one; you givit the cone's tip and base coordinates, plus an
angle (in your case, radius or falloff angle):

#macro cone_angle(Tip,Base,Angle)
#local Rad=tan(radians(Angle))*vlength(Tip-Base);
cone{Tip,0,Base,Rad open}
#end

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

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