POV-Ray : Newsgroups : povray.general : Scope of declared identifiers? : Re: Scope of declared identifiers? Server Time
16 Apr 2024 02:54:44 EDT (-0400)
  Re: Scope of declared identifiers?  
From: ab1jx
Date: 15 Dec 2018 13:35:00
Message: <web.5c1548de9ea205e6d4251dfa0@news.povray.org>
"ab1jx" <ala### [at] gmailcom> wrote:
> New to the group, I've been playing with Povray on and off for 20 years or so.
>
> I'm playing lately with cheap LEDs which can be found on Aliexpress under a
> penny each.  But they mostly have narrow beam widths, like 10 - 20 degrees, so
> you need to use a bunch of them, I'm trying to use Povray to model different
> arrangements as a feasibility study before building them in real life.
>
> I can do one LED and using scattering media I can have it project a beam of
> light.  But I #declare an identifier called substrate (a box really) and use
> that in a looks_like of the actual light source that casts a beam.  Except now I
> want to do that dozens of times, with the entire LED translated and rotated.
> Not only does substrate need to move but so does the point_at point of the
> light_source.  That doesn't seem to be happening.
>
> I #declare an object called ledbody and inside that I put the parts of the LED:
> the pins (box), body (cylinder), tip (sphere), substrate (box) and the
> light_source with looks_like {substrate}.  I'm currently defining substrate
> inside ledbody, seems to work about the same as doing it outside.  I do the
> whole thing at 0,0,0 and expect it to move and tilt with translate and rotate.
>
> I'm not sure if one object can be declared as being part of another, but
> looks_like for the light source needs an object (substrate).  The whole thing
> needs to be an object so I can replicate it.  It looks like the point_at point
> isn't moving, I only see beams from the first 2 LEDs.

Never mind, probably.  I was running out of -Z in my box with the scattering
media.  I was angling the replications of the LED back toward the viewer and the
beam disappeared.  Then I thought about it and extended the box, now all 5 of
them show beams at least somewhat.


Post a reply to this message

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