|
|
|
|
|
|
| |
| |
|
|
From: Jörg 'Yadgar' Bleimann
Subject: Am I just too stupid for programming?!?
Date: 20 Apr 2009 05:33:02
Message: <49ec414e@news.povray.org>
|
|
|
| |
| |
|
|
High!
Now I'm rid of the clippings... but then, I noticed an ugly gap in
Phobos' surface (see attachment). I thought this might be because of not
having connected the ends of each stripe of mesh faces (corresponding to
lines in the original map image), so I changed my code:
face_indices
{
638398 // added (399-1)*2 = 796
#declare a=0;
#while (a<399)
#declare b=0;
#while (b<800) // runs now to 800 rather than 799
<a*800+b, a*800+b+1, (a+1)*800+b>, // line 313
#if (b=799 & a=398)
<319999, 319200, 318400> // last triangle
#else
<(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>,
#end
#declare b=b+1;
#end
#declare a=a+1;
#end
}
...but all I get is the error message
"Parse Error: No matching } in 'face_indices', < found instead" (in line
313)!!!
See you in Khyberspace!
Yadgar
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> face_indices
> {
> 638398 // added (399-1)*2 = 796
> #declare a=0;
> #while (a<399)
> #declare b=0;
> #while (b<800) // runs now to 800 rather than 799
> <a*800+b, a*800+b+1, (a+1)*800+b>, // line 313
> #if (b=799 & a=398)
> <319999, 319200, 318400> // last triangle
> #else
> <(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>,
> #end
> #declare b=b+1;
> #end
> #declare a=a+1;
> #end
> }
>
> ...but all I get is the error message
>
> "Parse Error: No matching } in 'face_indices', < found instead" (in line
> 313)!!!
You are trying to add more indices than you have told POV at the top.
399*800*2 is 638400, but you told POV you are only having 638398 index
vectors.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> Now I'm rid of the clippings... but then, I noticed an ugly gap in
> Phobos' surface (see attachment).
No, I don't see attachment :P
> I thought this might be because of not
> having connected the ends of each stripe of mesh faces (corresponding to
> lines in the original map image), so I changed my code:
>
> face_indices
> {
> 638398 // added (399-1)*2 = 796
With a running from 0 to 398, this should be 399*2 = 798 (because you use 399
distinctive values for a)...
> #declare a=0;
> #while (a<399)
> #declare b=0;
> #while (b<800) // runs now to 800 rather than 799
> <a*800+b, a*800+b+1, (a+1)*800+b>, // line 313
> #if (b=799 & a=398)
> <319999, 319200, 318400> // last triangle
> #else
> <(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>,
.... and there should be some modulus operations in the vector building
statements, so wherever you have b+1, you should really have mod(b+1,800).
> #end
> #declare b=b+1;
> #end
> #declare a=a+1;
> #end
> }
>
> ...but all I get is the error message
>
> "Parse Error: No matching } in 'face_indices', < found instead" (in line
> 313)!!!
POV-Ray expects less vectors in the face_indices block than you supplied.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> face_indices
> {
> 638398 // added (399-1)*2 = 796
The nice thing about povray SDL is that you can write math. No need to
precalculate anything. Thus you can write:
face_indices
{
399*800
> #if (b=799 & a=398)
> <319999, 319200, 318400> // last triangle
> #else
> <(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>,
> #end
There's no need to do that. Instead of all that, just use:
<(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>
(Note no comma at the end.)
The SDL is flexible about commas. Use that fact to your advantage.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> > face_indices
> > {
> > 638398 // added (399-1)*2 = 796
>
> The nice thing about povray SDL is that you can write math. No need to
> precalculate anything. Thus you can write:
>
> face_indices
> {
> 399*800
But if you do, you better have the math right:
face_indices
{
399*800*2
because Yadgar is creating two faces per loop.
Post a reply to this message
|
|
| |
| |
|
|
From: Jörg 'Yadgar' Bleimann
Subject: Re: Am I just too stupid for programming?!?
Date: 20 Apr 2009 07:27:01
Message: <49ec5c05@news.povray.org>
|
|
|
| |
| |
|
|
clipka wrote:
> No, I don't see attachment :P
Here it is:
Post a reply to this message
Attachments:
Download '2009-04-20 phobos, take 2.jpg' (14 KB)
Preview of image '2009-04-20 phobos, take 2.jpg'
|
|
| |
| |
|
|
From: Jörg 'Yadgar' Bleimann
Subject: Re: Am I just too stupid for programming?!?
Date: 20 Apr 2009 07:42:03
Message: <49ec5f8b@news.povray.org>
|
|
|
| |
| |
|
|
High!
Warp wrote:
> There's no need to do that. Instead of all that, just use:
>
> <(a+1)*800+b, (a+1)*800+b+1, a*800+b+1>
>
> (Note no comma at the end.)
>
> The SDL is flexible about commas. Use that fact to your advantage.
It still doesn't work either, still the same error message... and, yes,
I also used mod(b, 800)!
Here is the current version:
mesh2 // Phobos
{
vertex_vectors
{
320000
#declare a=0;
#while (a<400)
#declare b=0;
#while (b<800)
#declare redval=eval_pigment(PhobosRelief, <(0.5+b)*(1/800),
(0.5+a)*(1/400), 0>).red * (14-8.1);
#declare greenval=eval_pigment(PhobosRelief, <(0.5+b)*(1/800),
(0.5+a)*(1/400), 0>).green * ((14-8.1)/255);
((8.1+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
}
face_indices
{
638400
#declare a=0;
#while (a<399)
#declare b=0;
#while (b<800)
<a*800+mod(b,800), a*800+mod(b+1,800), (a+1)*800+mod(b,800)>
<(a+1)*800+mod(b,800), (a+1)*800+mod(b+1,800), a*800+mod(b+1,800)>
#end
#declare b=b+1;
#end
#declare a=a+1;
#end
}
texture
{
pigment { color rgb 0.3 }
finish { F_Standard_Planetary_Surface }
}
rotate y*clock
translate Pos_Phobos/sc
}
See you in Khyberspace!
Yadgar
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> #while (b<800)
> <a*800+mod(b,800), a*800+mod(b+1,800), (a+1)*800+mod(b,800)>
> <(a+1)*800+mod(b,800), (a+1)*800+mod(b+1,800), a*800+mod(b+1,800)>
Btw, since b is always smaller than 800, "mod(b,800)" is exactly
identical to just "b". (Where it does make a difference is in
"mod(b+1,800)".)
Post a reply to this message
|
|
| |
| |
|
|
From: Jörg 'Yadgar' Bleimann
Subject: Re: Am I just too stupid for programming?!?
Date: 20 Apr 2009 08:35:02
Message: <49ec6bf6@news.povray.org>
|
|
|
| |
| |
|
|
High!
I must have placed one #end statement too much within my nested loop - I
removed it, and now it runs! At least the meridional gap is (almost)
gone, but as you can see in the latest image below, Christoph was right
in assuming that altering the scaling divisor won't help in the long run!
Onward to the next issue... the bounding problem!
See you in Khyberspace!
Yadgar
Now playing: We Are The Refugees (Ian Cussick)
Post a reply to this message
Attachments:
Download '2009-04-20 phobos, take 5.jpg' (12 KB)
Preview of image '2009-04-20 phobos, take 5.jpg'
|
|
| |
| |
|
|
|
|
| |
|
|