|
|
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'
|
|