POV-Ray : Newsgroups : povray.bugreports : slope problem Server Time
28 Mar 2024 08:41:12 EDT (-0400)
  slope problem (Message 1 to 7 of 7)  
From: jr
Subject: slope problem
Date: 31 Jan 2019 12:15:10
Message: <web.5c532c04b57e252c48892b50@news.povray.org>
hi,

I have some problems connecting spheres and cylinders.  :-)

the image (posted in p.b.i, same subject) should show each cylinder centred,
filling 90% of the distance between the respective sphere centres.

the bottom left I take to be a bug?

the real problem (for me) is the loss of accuracy, the vertical cylinder looks
correct, but, as the angle changes, the gaps to the spheres grow.  (I also think
the cylinders look "fatter" as they approach horizontal, but that may just be an
optical thing)

what can I do to get .. more uniformity?

alpha.10013324.unofficial, code used:

#version 3.8;

global_settings {assumed_gamma 1}

light_source {<-100,100,-100>, colour rgb 1 shadowless}

#declare SP = pigment {colour rgb <1,0,0>};

#declare SR = .1;
#declare CR = .025;

#declare N = 12;

#declare SC = array [N] {
  <0,4,0>, <1,4,0>, <2,4,0>, <3,4,0>, <4,4,0>, <5,4,0>,
  <6,4,0>, <7,4,0>, <7,3,0>, <7,2,0>, <7,1,0>, <7,0,0>
};

#declare SO = <0,0,0>;

sphere {SO, SR texture {SP}}
#for(I,0,N-1)
  sphere {SC[I], SR texture {SP}}
  #local p1_ = (SO - SC[I]) * .05;
  #local p2_ = (SO - SC[I]) * .95;
  cylinder {SO - p1_, SO - p2_, CR texture {pigment {colour rgb <1,1,0>}}}
#end

camera {
  perspective
  location <3.5,2,-6>
  look_at <3.5,2,0>
  right x * 1.334
  up <0,1,0>
}


regards, jr.


Post a reply to this message

From: clipka
Subject: Re: slope problem
Date: 31 Jan 2019 12:36:11
Message: <5c53320b$1@news.povray.org>
Am 31.01.2019 um 18:10 schrieb jr:
> hi,
> 
> I have some problems connecting spheres and cylinders.  :-)
> 
> the image (posted in p.b.i, same subject) should show each cylinder centred,
> filling 90% of the distance between the respective sphere centres.

Well, that's pretty much what I see them doing.

Of course since the distance changes as the angle changes, so do the 
gaps (because you computed each of them to be 5% of the total distance, 
from sphere center to start of cylinder).

Or I'm misunderstanding you, and what you're really complaining about 
are the illusionary effects, due to the spheres' "center of light" not 
coinciding with their center of mass - and likewise for the cylinders' 
"axis of light" not coinciding with their "axis of mass".


Post a reply to this message

From: jr
Subject: Re: slope problem
Date: 31 Jan 2019 12:55:00
Message: <web.5c5335eac81a0ad348892b50@news.povray.org>
hi,

clipka <ano### [at] anonymousorg> wrote:
> > the image (posted in p.b.i, same subject) should show each cylinder centred,
> > filling 90% of the distance between the respective sphere centres.
>
> Well, that's pretty much what I see them doing.

given that the "end" is a sphere, I would have expected the cylinders to
terminate in a curved shape, equidistant.  but I see a right angle.


> Of course since the distance changes as the angle changes, so do the
> gaps (because you computed each of them to be 5% of the total distance,
> from sphere center to start of cylinder).

yes.  and I use a "perspective" type camera.  nontheless, so close to the
objects, I expected less (much less) visual variation.  ibid their apparent
diameters, compared on three displays so it shouldn't be a pixel ratio thing.

> Or I'm misunderstanding you, and what you're really complaining about
> are the illusionary effects, due to the spheres' "center of light" not
> coinciding with their center of mass - and likewise for the cylinders'
> "axis of light" not coinciding with their "axis of mass".

does "shadowless" not ameliorate this effect?


regards, jr.


Post a reply to this message

From: jr
Subject: Re: slope problem
Date: 31 Jan 2019 13:25:01
Message: <web.5c533c8ec81a0ad348892b50@news.povray.org>
hi,

> clipka <ano### [at] anonymousorg> wrote:
> > Well, that's pretty much what I see them doing.
>
> given that the "end" is a sphere, I would have expected the cylinders to
> terminate in a curved shape, equidistant.  but I see a right angle.

ouch, sorry, I see now.  need to arrange the other spheres spherically to get
the equidistant ends.


> > Of course since the distance changes as the angle changes, so do the
> > gaps (because you computed each of them to be 5% of the total distance,
> > from sphere center to start of cylinder).

so how can one "fudge" it, ie make the cylinders end a predictable distance from
each sphere?


regards, jr.


Post a reply to this message

From: clipka
Subject: Re: slope problem
Date: 31 Jan 2019 13:44:23
Message: <5c534207$1@news.povray.org>
Am 31.01.2019 um 19:21 schrieb jr:
> hi,
> 
>> clipka <ano### [at] anonymousorg> wrote:
>>> Well, that's pretty much what I see them doing.
>>
>> given that the "end" is a sphere, I would have expected the cylinders to
>> terminate in a curved shape, equidistant.  but I see a right angle.
> 
> ouch, sorry, I see now.  need to arrange the other spheres spherically to get
> the equidistant ends.
> 
> 
>>> Of course since the distance changes as the angle changes, so do the
>>> gaps (because you computed each of them to be 5% of the total distance,
>>> from sphere center to start of cylinder).
> 
> so how can one "fudge" it, ie make the cylinders end a predictable distance from
> each sphere?

Preusuming you have the "central" sphere at P1, and a "remote" sphere at 
P2, and you want a distance of D between sphere centers and the cylinder 
ends, then

     V = P2 - P1

is the vector describing direction _and_ distance of the cylinder you want;

     Vn = vnormalize(Vn)

is the unit-length directionof that vector; and

     Q1 = P1 + Vn*D
     Q2 = P2 - Vn*D

are the points you want the cylinder ends to be at.


Post a reply to this message

From: clipka
Subject: Re: slope problem
Date: 31 Jan 2019 13:47:36
Message: <5c5342c8@news.povray.org>
Am 31.01.2019 um 18:53 schrieb jr:

>> Or I'm misunderstanding you, and what you're really complaining about
>> are the illusionary effects, due to the spheres' "center of light" not
>> coinciding with their center of mass - and likewise for the cylinders'
>> "axis of light" not coinciding with their "axis of mass".
> 
> does "shadowless" not ameliorate this effect?

No; for the illusionary offsets to vanish, you need to light the objects 
straight from the front.


Post a reply to this message

From: jr
Subject: Re: slope problem
Date: 31 Jan 2019 14:10:00
Message: <web.5c5346ebc81a0ad348892b50@news.povray.org>
hi,

clipka <ano### [at] anonymousorg> wrote:
> Am 31.01.2019 um 19:21 schrieb jr:
> > so how can one "fudge" it, ie make the cylinders end a predictable distance from
> > each sphere?
>
> Preusuming you have the "central" sphere at P1, and a "remote" sphere at
> P2, and you want a distance of D between sphere centers and the cylinder
> ends, then
>
>      V = P2 - P1
>
> is the vector describing direction _and_ distance of the cylinder you want;
>
>      Vn = vnormalize(Vn)
>
> is the unit-length directionof that vector; and
>
>      Q1 = P1 + Vn*D
>      Q2 = P2 - Vn*D
>
> are the points you want the cylinder ends to be at.

thank you very much, will try.

(and thanks re light positioning)


regards, jr.


Post a reply to this message

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