POV-Ray : Newsgroups : povray.bugreports : slope problem Server Time18 Sep 2024 03:08:16 EDT (-0400)
 slope problem (Message 1 to 7 of 7)
 From: jr Subject: slope problem Date: 31 Jan 2019 12:15:10 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5c532c04b57e252c48892b50%40news.povray.org",
"headline": "slope problem",
"dateCreated": "2019-01-31T17:15:10+00:00",
"datePublished": "2019-01-31T17:15:10+00:00",
"author": {
"@type": "Person",
"name": "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.

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.
```
 From: clipka Subject: Re: slope problem Date: 31 Jan 2019 12:36:11 Message: <5c53320b\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5c53320b%241%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T17:36:11+00:00",
"datePublished": "2019-01-31T17:36:11+00:00",
"author": {
"@type": "Person",
"name": "clipka"
}
}
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".
```
 From: jr Subject: Re: slope problem Date: 31 Jan 2019 12:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5c5335eac81a0ad348892b50%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T17:55:00+00:00",
"datePublished": "2019-01-31T17:55:00+00:00",
"author": {
"@type": "Person",
"name": "jr"
}
}
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.
```
 From: jr Subject: Re: slope problem Date: 31 Jan 2019 13:25:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5c533c8ec81a0ad348892b50%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T18:25:01+00:00",
"datePublished": "2019-01-31T18:25:01+00:00",
"author": {
"@type": "Person",
"name": "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?

regards, jr.
```
 From: clipka Subject: Re: slope problem Date: 31 Jan 2019 13:44:23 Message: <5c534207\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5c534207%241%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T18:44:23+00:00",
"datePublished": "2019-01-31T18:44:23+00:00",
"author": {
"@type": "Person",
"name": "clipka"
}
}
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.
```
 From: clipka Subject: Re: slope problem Date: 31 Jan 2019 13:47:36 Message: <5c5342c8@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5c5342c8%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T18:47:36+00:00",
"datePublished": "2019-01-31T18:47:36+00:00",
"author": {
"@type": "Person",
"name": "clipka"
}
}
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.
```
 From: jr Subject: Re: slope problem Date: 31 Jan 2019 14:10:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5c5346ebc81a0ad348892b50%40news.povray.org",
"headline": "Re: slope problem",
"dateCreated": "2019-01-31T19:10:00+00:00",
"datePublished": "2019-01-31T19:10:00+00:00",
"author": {
"@type": "Person",
"name": "jr"
}
}
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.
```