POV-Ray : Newsgroups : povray.binaries.images : Amalthea, now with brightness 1 and assumed_gamma 1.5 Server Time
31 Jul 2024 16:30:38 EDT (-0400)
  Amalthea, now with brightness 1 and assumed_gamma 1.5 (Message 1 to 10 of 19)  
Goto Latest 10 Messages Next 9 Messages >>>
From: Jörg 'Yadgar' Bleimann
Subject: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 7 May 2009 11:40:45
Message: <4a0300fd@news.povray.org>
High!

I wonder why these extremely bright and saturated spots near Amalthea's 
north pole occur...

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2009-05-07 jupiter and amalthea, take 4.jpg' (54 KB)

Preview of image '2009-05-07 jupiter and amalthea, take 4.jpg'
2009-05-07 jupiter and amalthea, take 4.jpg


 

From: clipka
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 7 May 2009 13:30:00
Message: <web.4a031a6ce9ba10c2468059640@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> I wonder why these extremely bright and saturated spots near Amalthea's
> north pole occur...

Are you sure your mesh is ok at the poles?

Note that the northern- and southernmost stretches should have simple triangles
instead of triangle pairs.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 8 May 2009 18:33:59
Message: <4a04b357@news.povray.org>
High!

clipka wrote:

> Are you sure your mesh is ok at the poles?

No, it isn't (see attached picture)

> Note that the northern- and southernmost stretches should have simple triangles
> instead of triangle pairs.

Yes, the first and last rows of triangles must share one vertex 
respectively, which is the south and north pole!

So I corrected my mesh2 code... but than ran into another
problem - Mesh face index out of range after 634404 faces! Why?
I calculated the vertices to be left out to 2 * (800-1) = 1598;
as the rows of faces are connected at the ends, the corresponding number 
of faces to be removed should be 2 * 800 = 1600... so the overall number 
of vertices should be 318402 rather than 320000, the overall number of 
faces 636800 rather than 638400!

Here's the code (coordinates for south and north pole have been 
calculated in a pass before):

// beginning of code
mesh2 // Amalthea
   {
     vertex_vectors
     {
       318402
       <0, -53.04356, 0>/sc // south pole
       #declare a=1;
       #while (a<399)
         #declare b=0;
         #while (b<800)
           #declare redval=eval_pigment(AmaltheaRelief, 
<(0.5+b)*(1/800), (0.5+a)*(1/400), 0>).red * (148.3-51.8);
           #declare greenval=eval_pigment(AmaltheaRelief, 
<(0.5+b)*(1/800), (0.5+a)*(1/400), 0>).green * ((148.3-51.8)/255);
 
((51.8+redval+greenval)*<sin(radians(b*(360/800)))*cos(radians(-90+a*(180/400))), 
sin(radians(-90+a*(180/400))), 
cos(radians(b*(360/800)))*cos(radians(-90+a*(180/400)))>)/sc
           #declare b=b+1;
         #end
         #declare a=a+1;
       #end
       <0, 53.13458, 0>/sc // north pole
     }
     face_indices
     {
       636800
       #declare fa=0;
       #declare a=0;
       #while (a<399)
         #declare b=0;
         #while (b<800)
           #switch (a)
             #case (0)
               <0, b, b+1>
               #declare fa=fa+1;
             #break
             #range (1, 398)
               <a*800+b, a*800+mod(b+1,800), (a+1)*800+b>,
               <(a+1)*800+b, (a+1)*800+mod(b+1,800), a*800+mod(b+1,800)>
               #declare fa=fa+2;
             #break
             #case (399)
               <a*800+b, a*800+mod(b+1,800), 636799>
               #declare fa=fa+1;
             #break
           #end
           #warning str(fa, 6, 0)
           #declare b=b+1;
         #end
         #declare a=a+1;
       #end
     }
     texture
     {
       pigment { color rgb <179, 101,46>/255 }
       finish { F_Standard_Planetary_Surface }
     }
     translate Pos_Amalthea/sc
   }
// end of code

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2009-05-07 amalthea's north pole, take 1.jpg' (70 KB)

Preview of image '2009-05-07 amalthea's north pole, take 1.jpg'
2009-05-07 amalthea's north pole, take 1.jpg


 

From: clipka
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 08:55:00
Message: <web.4a057cb8e9ba10c2d7f7e4230@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> So I corrected my mesh2 code... but than ran into another
> problem - Mesh face index out of range after 634404 faces! Why?
> I calculated the vertices to be left out to 2 * (800-1) = 1598;
> as the rows of faces are connected at the ends, the corresponding number
> of faces to be removed should be 2 * 800 = 1600... so the overall number
> of vertices should be 318402 rather than 320000, the overall number of
> faces 636800 rather than 638400!

I see the following errors in your code.

I note that you chose your poles to occupy vertices 0 and 636799, respectively;
the rows of vertices in between should therefore occupy vertices 1 through 800,
801 through 1600, 1601 through 2400, etc.

>      face_indices
>      {
>        636800
>        #declare fa=0;
>        #declare a=0;
>        #while (a<399)
>          #declare b=0;
>          #while (b<800)
>            #switch (a)
>              #case (0)
>                <0, b, b+1>

The sequence of vectors you need is <0,1,2>, <0,2,3>, <0,3,4>, ..., <0,800,1>;
to this end, the formula should be:

  <0, 1+b, 1+mod(b+1,800)>

>                #declare fa=fa+1;
>              #break
>              #range (1, 398)
>                <a*800+b, a*800+mod(b+1,800), (a+1)*800+b>,
>                <(a+1)*800+b, (a+1)*800+mod(b+1,800), a*800+mod(b+1,800)>

The sequence of vectors you actually need here is:

  <1,2,801>, <801,2,802>  // a = 1, b = 0
  <2,3,802>, <802,3,803>  // a = 1, b = 1
  <3,4,803>, <803,4,804>  // a = 1, b = 2
  ...
  <800,1,1600>, <1600,1,801>  // a = 1, b = 799
  <801,802,1601>, <1601,802,1602>  // a = 2, b = 0
  ...

(Note that I swapped the second triangle's vertices, to get the same "direction
of rotation" for both triangles; this is important if you want to define
separate inside and outside textures.)

So the formula should be:

  <1+(a-1)*800+b, 1+(a-1)*800+mod(b+1,800), 1+a*800+b>,
  <1+a*800+b, 1+(a-1)*800+mod(b+1,800), 1+a*800+mod(b+1,800)>

>                #declare fa=fa+2;
>              #break
>              #case (399)

This doesn't make sense. In the #while loop, you specified that a<399, and now
you check for a=399.

>                <a*800+b, a*800+mod(b+1,800), 636799>

This formula has the same problem as the two above; I'll leave it as an
excercise to you to figure out the correct formula for this one ;)

>                #declare fa=fa+1;
>              #break
>            #end
>            #warning str(fa, 6, 0)
>            #declare b=b+1;
>          #end
>          #declare a=a+1;
>        #end
>      }


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 09:45:30
Message: <4a0588fa@news.povray.org>
High!

Meanwhile, I changed the code:

  mesh2 // Amalthea
   {
     vertex_vectors
     {
       318402
       <0, -53.04356, 0>/sc // south pole
       #declare a=1;
       #while (a<399)
         #declare b=0;
         #while (b<800)
           #declare redval=eval_pigment(AmaltheaRelief, 
<(0.5+b)*(1/800), (0.5+a)*(1/400), 0>).red * (148.3-51.8);
           #declare greenval=eval_pigment(AmaltheaRelief, 
<(0.5+b)*(1/800), (0.5+a)*(1/400), 0>).green * ((148.3-51.8)/255);
 
((51.8+redval+greenval)*<sin(radians(b*(360/800)))*cos(radians(-90+a*(180/400))), 
sin(radians(-90+a*(180/400))), 
cos(radians(b*(360/800)))*cos(radians(-90+a*(180/400)))>)/sc
           #declare b=b+1;
         #end
         #declare a=a+1;
       #end
       <0, 53.13458, 0>/sc // north pole
     }
     face_indices
     {
       635200
       #declare fa=0;
       #declare a=0;
       #while (a<398)
         #declare b=0;
         #while (b<800)
           #switch (a)
             #case (0)
               <0, a+1+b, a+1+mod(b+1,800)>
               #declare fa=fa+1;
             #break
             #range (1, 396)
               <1+a*800+b, 1+a*800+mod(b+1,800), 1+(a+1)*800+b>,
               <1+(a+1)*800+b, 1+(a+1)*800+mod(b+1,800), 
1+a*800+mod(b+1,800)>
               #declare fa=fa+2;
             #break
             #case (397)
               <1+a*800+b, 1+a*800+mod(b+1,800), 318401>
               #declare fa=fa+1;
             #break
           #end
           #warning str(fa, 6, 0)
           #declare b=b+1;
         #end
         #declare a=a+1;
       #end
     }
     texture
     {
       pigment { color rgb <179, 101,46>/255 }
       finish { F_Standard_Planetary_Surface }
     }
     translate Pos_Amalthea/sc
   }

...but still there is that gaping hole at the north pole! And why 635200 
faces? Shouldn't it be rather 636800, i. e. (a-3)*2*b+2*b ?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: clipka
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 10:50:00
Message: <web.4a05969de9ba10c2d7f7e4230@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> Meanwhile, I changed the code:

Boy, you and your moon mesh are a hopeless case :P

Let's see what we can do. First, let's re-compute all the values...

You have 2 poles, and "loops" of 800 vertices each, numbered a=1 through a=398,
i.e. 398 distinct loops (for later reference, I'll identify the vertex loops by
their corresponding "a" value, i.e. "loop 1" through "loop 398").

According to my calculation, that makes a total of 318402 vertices, fitting your
results.

(Make a mental note here that the very first loop - loop 1 - occupies vertex
indices 1 through 800, loop 2 occopies indices 801 through 1600, and so on.)

Now to the faces: They're arranged in belts. Two of them - those at the poles -
have 800 triangles each. The remaining ones, having 1600 triangles each,
connect two vertex loop pairs each, starting with loops (1;2), through
(397;398) - or, more generally, (a;a+1) with a=1 through a=397. Therefore
obviously, you have a total of 397 such "full" belts, and 2 "half" belts at the
poles.

As a result, you should have a total of 636800 triangles.

Okay, looks like you got *that* part of the math right in the first place :P

Therefore, your code must still be bogus somewhere, as it doesn't fit this bill;
let's see:

>      face_indices
>      {
>        635200

This should be 636800, as you correctly assumed earlier.

>        #declare fa=0;
>        #declare a=0;
>        #while (a<398)

As demonstrated above, you have "full" belts of triangles ranging from a=1
through a=397, so your final "polar" belt should correspond to a=398.
Therefore, this should be "#while (a<=398)" or "#while (a<399)".

This is where you lost those 1600 triangles.

>          #declare b=0;
>          #while (b<800)
>            #switch (a)
>              #case (0)
>                <0, a+1+b, a+1+mod(b+1,800)>
>                #declare fa=fa+1;
>              #break
>              #range (1, 396)

This should of course be "#range (1, 397)".

>                <1+a*800+b, 1+a*800+mod(b+1,800), 1+(a+1)*800+b>,
>                <1+(a+1)*800+b, 1+(a+1)*800+mod(b+1,800),
> 1+a*800+mod(b+1,800)>

Look carefully at the sequence this generates for a=1:

  <801,802,1601>, <1601,1602,802>,
  <802,803,1602>, <1602,1603,803>,
  ...

These are all "loop 2" and "loop 3" vertex indices; loop 1 is connected on one
side to the pole, but you forgot to also connect it to loop 2 (which explains
the gaping hole you saw around the pole). The correct formula should be (as
already suggested in my previous post):

  <1+(a-1)*800+b, 1+(a-1)*800+mod(b+1,800), 1+a*800+b>,
  <1+a*800+b, 1+a*800+mod(b+1,800), 1+(a-1)*800+mod(b+1,800)>

>                #declare fa=fa+2;
>              #break
>              #case (397)

Of course this should be "#case (398)" instead.

>                <1+a*800+b, 1+a*800+mod(b+1,800), 318401>

And this formula should be

  <1+(a-1)*800+b, 1+(a-1)*800+mod(b+1,800), 318401>

That should fit your bill again at last.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 17:41:04
Message: <4a05f870@news.povray.org>
High!

I applied your suggestions - but the hole at the north pole (not at the 
south pole!) remained!

Obviously, the last belt (#case (398)) doesn't connect - and how should 
it do, as its "baseline" still is a-1, i. e. 397?

But when, in #case (398) I replace a-1 by a, I again get that "face 
index out of range error! Why? The absolute number of faces did not 
change...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: clipka
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 19:15:00
Message: <web.4a060d5ae9ba10c2c5e517f90@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> I applied your suggestions - but the hole at the north pole (not at the
> south pole!) remained!
>
> Obviously, the last belt (#case (398)) doesn't connect - and how should
> it do, as its "baseline" still is a-1, i. e. 397?
>
> But when, in #case (398) I replace a-1 by a, I again get that "face
> index out of range error! Why? The absolute number of faces did not
> change...

Yadgar, I guess you need to approach this thing more systematically; right now,
it seems like you're still using the "tweak it until it works" approach, which
doesn't really seem to get you anywhere at the moment.

What you need is a clear picture of what "loop number" actually corresponds to
which vertex index numbers; and what "belt" should connect which pair of
"loops".

I'm not talking about a "mental picture" here. Do write it down. Take this
advice from a professional software developer: If at first you don't succeed,
*document*. To a painstaking detail. It forces to formalize the mental picture
of the intended solution, which is often fuzzier than one thinks.


For instance, the notion that "1+a*800" should be the correct vertex index
baseline for loop #a may seem intuitive - but as a matter of fact it's wrong.
For instance, loop #1 - the very first loop - is comprised of vertices
#1..#800, matching a loop baseline formula of 1+(a-1)*800.

So the baseline I suggested for the last belt - #398 - matches the baseline for
loop #398 - the last full loop, which belt #398 should connect to the pole.

Trust me - sometimes I do know what I'm doing :P

So there still must be a different problem.


Post a reply to this message

From: clipka
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 19:25:00
Message: <web.4a06100ee9ba10c2c5e517f90@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> I applied your suggestions - but the hole at the north pole (not at the
> south pole!) remained!

Are you sure that this is not

(a) an optical illusion? (maybe you have the pole's co-ordinate wrong and drawn
inward, giving you "only" a shadowed dent)

(b) a scale or precision related issue?


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Amalthea, now with brightness 1 and assumed_gamma 1.5
Date: 9 May 2009 19:56:38
Message: <4a061836@news.povray.org>
High!

clipka wrote:

> For instance, the notion that "1+a*800" should be the correct vertex index
> baseline for loop #a may seem intuitive - but as a matter of fact it's wrong.
> For instance, loop #1 - the very first loop - is comprised of vertices
> #1..#800, matching a loop baseline formula of 1+(a-1)*800.

I once again checked it via pocket calculator - and yes, you're right! 
All faces are properly defined - only the north polar belt (i. e. belt 
#398, with baseline vertices going like <317601, 317602, 318401>, 
<317602, 317603, 318401> and so on) is not rendered at all! And it 
probably is a matter of the very last vertex, #318401...

(10 minutes later)

No, it isn't... I found out that when I change the divisor in the vertex 
definition section from 400 to 398, the north polar gap disappears! So 
the result might not be entirely "geographically" accurate, but 
esthetically satisfying...

But I still doubt whether sticking to this kind of work methods will 
ever make me a commercially successful programmer... I'm more like a 
shaggy drop-out log cabin tinkerer than a sophisticated computer scientist!

By the way, when using radiosity the strangely "glowing" portions near 
Amalthea's north pole continue to exist - so it probably is a matter of 
radiosity rather than mesh geometry!

See you in Khyberspace!

Yadgar


Post a reply to this message

Goto Latest 10 Messages Next 9 Messages >>>

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