POV-Ray : Newsgroups : povray.general : Scope of declared identifiers? : Scope of declared identifiers? Server Time
26 Apr 2024 09:07:41 EDT (-0400)
  Scope of declared identifiers?  
From: ab1jx
Date: 15 Dec 2018 13:10:01
Message: <web.5c1541eb8a1acc71d4251dfa0@news.povray.org>
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.


Post a reply to this message

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