POV-Ray : Newsgroups : povray.binaries.images : Flexible lamp neck Server Time
29 Mar 2024 08:19:47 EDT (-0400)
  Flexible lamp neck (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Cousin Ricky
Subject: Re: Flexible lamp neck
Date: 20 Feb 2021 15:14:35
Message: <60316dab$1@news.povray.org>
On 2021-02-10 6:58 PM (-4), Cousin Ricky wrote:
> I figured out how to model a flexible lamp neck [snip]

Sneak preview.  The harlequin colors are there for testing.

That other lamp in the left background is a rudimentary place holder 
that I've been using for the past 5 years.


Post a reply to this message


Attachments:
Download 'desklamp-sneak_preview.jpg' (63 KB)

Preview of image 'desklamp-sneak_preview.jpg'
desklamp-sneak_preview.jpg


 

From: Mr
Subject: Re: Flexible lamp neck
Date: 20 Feb 2021 15:40:08
Message: <web.60317378d0c3b58b16086ed00@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-02-10 6:58 PM (-4), Cousin Ricky wrote:
> > I figured out how to model a flexible lamp neck [snip]
>
> Sneak preview.  The harlequin colors are there for testing.
>
> That other lamp in the left background is a rudimentary place holder
> that I've been using for the past 5 years.

It looks neat, as something out of toy story ! I find the neck a little too
uniformly reflective, is there conserve_energy with fresnel and IOR dependant
reflection? Some blurry reflections would really 'shine' here... but reflected
checker could of course be an artistic choice.


Post a reply to this message

From: Bald Eagle
Subject: Re: Flexible lamp neck
Date: 20 Feb 2021 18:25:00
Message: <web.60319a28d0c3b58b1f9dae300@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-02-10 6:58 PM (-4), Cousin Ricky wrote:
> > I figured out how to model a flexible lamp neck [snip]
>
> Sneak preview.  The harlequin colors are there for testing.
>
> That other lamp in the left background is a rudimentary place holder
> that I've been using for the past 5 years.

Well, you've certainly spent a lot of time honing this object.
The textures are very nice, and they really replicate the real thing.

The base just looks - real.  The shape, the gloss, the texture on the toggle
switch, the press-fitting of the lamp neck.  Even the little gap between the
base and the floor, where the felt pad presumably is.

The light bulb looks real as well.  I looks like thin glass with a thin layer of
kaolin powder coated onto the inside.

It's neat that the texture on the outside of the shade "peeks out" a bit beyond
the inner white.

Should be interesting to see your power cord, and the lit final product.

Of course you're going to want to give the neck spline a bit of non-uniform
wiggle, and from a math and rigging perspective, one would have to define a
minimum radius that the FMC/Greenfield style neck can achieve and somehow
disallow sharper bends.  Just a math/programming observation and a puzzle to
suggest.  :)


Your placeholder has that antialiasing artifact that just got brought up.
The square in front of it is rather bright - a trick of the lighting and
falloff?

That thing is gonna look _real_ with an HDR environment.   :O

As always, very nice, very meticulous work.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 00:08:08
Message: <6031eab8$1@news.povray.org>
On 2021-02-20 7:24 PM (-4), Bald Eagle wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>>
>> Sneak preview.  The harlequin colors are there for testing.
>>
>> That other lamp in the left background is a rudimentary place holder
>> that I've been using for the past 5 years.
> 
> Well, you've certainly spent a lot of time honing this object.
> The textures are very nice, and they really replicate the real thing.
> 
> The base just looks - real.  The shape, the gloss, the texture on the toggle
> switch, the press-fitting of the lamp neck.  Even the little gap between the
> base and the floor, where the felt pad presumably is.

That _is_ the felt (or rubber) pad.  It's just dark like a shadow.

> The light bulb looks real as well.  I looks like thin glass with a thin layer of
> kaolin powder coated onto the inside.

This was a v3.7 render, so I used a layered texture in lieu of 
finish-level Fresnel.  The material macro autodetects v3.8 and would 
just go straight for the finish-level Fresnel, but you have me wondering 
if I should bother.  When I look at a frosted bulb IRL (actually, an LED 
lookalike), it looks like there's some SSLT going on there, but I wasn't 
going to bother with it.  Maybe the layered texture looks more realistic 
than the finish-level Fresnel?

> It's neat that the texture on the outside of the shade "peeks out" a bit beyond
> the inner white.

That's a happy side effect of an attempt to avoid the radiosity 
artifacts that would otherwise manifest when the lamp is switched on. 
When I first coded the place holders, I ended up with nasty white spots 
all over my render rig until I set no_radiosity on the fixtures.  But I 
only want to do this for the inside of the hood.

> Should be interesting to see your power cord, and the lit final product.

The power cord is still in my "future plans" bin.  I'm thinking about 
commandeering the Rope module from the object collection, as it may have 
already solved the issues that will certainly turn up.  My biggest 
concern here is the plug: different countries have different standards, 
and I'm wondering if the plug should be its own module with 
international options.

> Of course you're going to want to give the neck spline a bit of non-uniform
> wiggle, and from a math and rigging perspective, one would have to define a
> minimum radius that the FMC/Greenfield style neck can achieve and somehow
> disallow sharper bends.  Just a math/programming observation and a puzzle to
> suggest.  :)

A minimum radius will naturally fall out of the constraints that I put 
in the lamp macro.  I'm glad you're going to work on the wiggle.  ;)

> Your placeholder has that antialiasing artifact that just got brought up.

Yes, it is creepy, but I explained why I'd rather live with it.

> The square in front of it is rather bright - a trick of the lighting and
> falloff?

Yes, that's exactly what that is.  The light source uses the bulb radius 
as its fade distance, which results in very bright illumination near the 
light, and a rapid falloff as the distance increases.  If you look 
carefully, you'll notice that the dark squares closest to the lamp are 
also somewhat lighter.

> That thing is gonna look _real_ with an HDR environment.   :O
That's half the intention.

Notice the flying saucer shaped reflection in the blue stripe of the 
hood: that is the distorted reflection of a second place holder lamp 
outside the right of the frame.  Only with hyper-white illumination can 
such a reflection be realistic.  Even so, the light is only 10% of 
normal brightness, because I'm only using it as a fill.  (The visible 
place holder is also a fill.  The main light source happens not to be 
reflected anywhere.)

One problem that concerns me is reflections of lit bulbs.  If the 
reflecting surface has a specular or Phong highlight, you end up with 
twice the reflected light.  For this render environment, I tentatively 
solved this by setting no_reflection on the place holder's bulb, but 
this results in a highlight that doesn't reflect the extent of the bulb. 
  When I release the source code for the lamp, there will be a parameter 
to turn the reflection on or off, and let the user decide what to do 
with highlights--unless someone has a better idea.

> As always, very nice, very meticulous work.

Thanks!


Post a reply to this message

From: Cousin Ricky
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 12:18:28
Message: <603295e4$1@news.povray.org>
On 2021-02-20 7:24 PM (-4), Bald Eagle wrote:
> 
> Of course you're going to want to give the neck spline a bit of non-uniform
> wiggle, and from a math and rigging perspective, one would have to define a
> minimum radius that the FMC/Greenfield style neck can achieve and somehow
> disallow sharper bends.  Just a math/programming observation and a puzzle to
> suggest.  :)

Not sure how to prevent this kind of accident.


Post a reply to this message


Attachments:
Download 'lamp-xtreme_bend.jpg' (21 KB)

Preview of image 'lamp-xtreme_bend.jpg'
lamp-xtreme_bend.jpg


 

From: Bald Eagle
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 13:45:00
Message: <web.6032a90ed0c3b58b1f9dae300@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-02-20 7:24 PM (-4), Bald Eagle wrote:
> >
> > Of course you're going to want to give the neck spline a bit of non-uniform
> > wiggle, and from a math and rigging perspective, one would have to define a
> > minimum radius that the FMC/Greenfield style neck can achieve and somehow
> > disallow sharper bends.  Just a math/programming observation and a puzzle to
> > suggest.  :)
>
> Not sure how to prevent this kind of accident.

Hire better people at the manufacturing plant?
Don't treat the lamp like a 1971 American Tourister?

I would say toggle an algorithm on or off to allow the modeler the freedom to do
whatever they want.

When on:
A simple algorithm might be to define two bounding spheres centered at the shade
opening and at the center of the base top, and then just do simple collision
detection.  Translate the offending spline position away from the base, and then
maybe check to see that it's not intersecting the floor / desk top, etc.

Reading back over this, it occurred to me that a way to disallow such a
too-sharp bend would be to define a minimum radius and then do collision testing
with the sphere defined by the prior inflection points - if that makes sense.

But that brings up an issue I was puzzling over when I was trying to crumple a
cardboard box - I wanted to create the wrinkles and creases and folds, but
define some sort of constraint so that the sum of all of those things was the
same as the original height of the cardboard...

When I was going through all of the Bezier spline stuff, I recall coming across
a way to calculate the arc length of a curve....  but that will have to wait
until I get a second wind.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 13:54:02
Message: <6032ac4a$1@news.povray.org>
On 2021-02-21 1:08 AM (-4), Cousin Ricky wrote:
> On 2021-02-20 7:24 PM (-4), Bald Eagle wrote:
> 

>> thin layer of
>> kaolin powder coated onto the inside.
> 
> This was a v3.7 render, so I used a layered texture in lieu of 

> just go straight for the finish-level Fresnel, but you have me wondering 

> lookalike), it looks like there's some SSLT going on there, but I wasn't 

> than the finish-level Fresnel?

This is a simplified version of the bulb texture.  Of course, the 
production texture will have emission and allow for colored glass.

There are subtle differences between POV-Ray versions.  Note the wimpy 
highlight on the left edge of the v3.5 sphere.  This is likely due to AA 
pre-clipping.

The value of sotd_c_Ambient is, of course, zero for this radiosity render.

----------[BEGIN CODE EXCERPT]-----------
   material
   { #if (version < 3.8)
       #declare s_Annot = "Layered texture"
       texture
       { pigment { rgb 1 }
         finish
         { diffuse 0.75
           ambient 0.75 * sotd_c_Ambient
         }
       }
       texture
       { pigment { rgbf 1 }
         finish
         { reflection { 0 1 fresnel } conserve_energy
           specular 6.67
           roughness 0.001
         }
       }
     #else
       #declare s_Annot = "Finish-level Fresnel"
       texture
       { pigment { rgb 1 }
         finish
         { fresnel 1
           reflection { 0 1 } conserve_energy
           specular albedo 1
           roughness 0.001
           diffuse 0.75
           ambient 0.75 * sotd_c_Ambient
         }
       }
     #end
     interior { ior 1.523 }
   }
-----------[END CODE EXCERPT]------------


Post a reply to this message


Attachments:
Download 'frosted_glass_versions-pbi.jpg' (43 KB)

Preview of image 'frosted_glass_versions-pbi.jpg'
frosted_glass_versions-pbi.jpg


 

From: Cousin Ricky
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 14:18:36
Message: <6032b20c$1@news.povray.org>
On 2021-02-21 2:40 PM (-4), Bald Eagle wrote:
> 
> When I was going through all of the Bezier spline stuff, I recall coming across
> a way to calculate the arc length of a curve....  but that will have to wait
> until I get a second wind.

For a circular arc, by definition it's

   arc_length = angle_in_radians * radius_of_curvature


to me, but can probably be explained to a 5 year old on Numberphile.


Post a reply to this message

From: Bald Eagle
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 14:45:00
Message: <web.6032b79ed0c3b58b1f9dae300@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-02-21 2:40 PM (-4), Bald Eagle wrote:
> >
> > When I was going through all of the Bezier spline stuff, I recall coming across
> > a way to calculate the arc length of a curve....


> to me, but can probably be explained to a 5 year old on Numberphile.

https://www.mathsisfun.com/calculus/arc-length.html

I guess it's easier than I recall, or was presented to be.

I suppose tidying it all up for the 4 Bernstein polynomials may look a wee bit
messy, but it probably shouldn't be too bad, since I went well past that and
into the weeds of Gaussian curvature territory...


Post a reply to this message

From: Bald Eagle
Subject: Re: Flexible lamp neck
Date: 21 Feb 2021 21:00:01
Message: <web.60330f52d0c3b58b1f9dae300@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I guess it's easier than I recall, or was presented to be.

Or not, but apparently there are libraries that do it, so maybe they can be used
somehow, or just the simple multiple-line-segment method would be good enough
for the present purpose.

https://raphlinus.github.io/curves/2018/12/28/bezier-arclength.html


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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