12-19-2022, 09:59 PM
Code: (Select All)
'sky install
da = 20 'resolution sphere X
db = 8 'resolutin sphere Y
sky_points = da * db: DIM sky_points(sky_points - 1, 9), sq(sky_points - 1, 7): sky_image = _LOADIMAGE("sky.jpg", 33)
FOR da2 = 0 TO da - 1: dega = 360 / (da - 1) * da2 * pip180: FOR db2 = 0 TO db - 1: degb = 180 / (db - 1) * db2 * pip180: ss = 1400
ap = da2 * db + db2: sky_points(ap, 0) = SIN(degb) * COS(dega) * ss: sky_points(ap, 1) = SIN(degb) * SIN(dega) * ss: sky_points(ap, 2) = COS(degb) * ss: NEXT db2, da2
FOR da2 = 0 TO da - 2: FOR db2 = 0 TO db - 2: sqa = da2 * db + db2: sq(sqa, 0) = sqa: sq(sqa, 1) = sq(sqa, 0) + 1: sq(sqa, 2) = sq(sqa, 0) + db: sq(sqa, 3) = sq(sqa, 2) + 1
sq(sqa, 4) = _WIDTH(sky_image) - (_WIDTH(sky_image) / (da - 1) * da2) - 1: sq(sqa, 5) = _WIDTH(sky_image) - (_WIDTH(sky_image) / (da - 1) * (da2 + 1)) - 1
sq(sqa, 6) = INT(_HEIGHT(sky_image) / (db - 1) * db2): sq(sqa, 7) = INT(_HEIGHT(sky_image) / (db - 1) * (db2 + 1)): NEXT db2, da2
'---------------------------------------------
'to cycle
sky_draw: 'draw sky
'rotating
FOR actual_point = 0 TO sky_points - 1:
sky_points(actual_point, 4) = sky_points(actual_points,0)
sky_points(actual_point, 5) = sky_points(actual_points,1)
sky_points(actual_point, 6) = sky_points(actual_points,2)
rotate_to_maptriangle sky_points(actual_point, 4),sky_points(actual_point, 5),sky_points(actual_point, 6)
NEXT actual_point
FOR asq = 0 TO sky_points - 1: wx0 = sky_points(sq(asq, 0), 4): wy0 = sky_points(sq(asq, 0), 5): wz0 = sky_points(sq(asq, 0), 6)
wx1 = sky_points(sq(asq, 1), 4): wy1 = sky_points(sq(asq, 1), 5): wz1 = sky_points(sq(asq, 1), 6)
wx2 = sky_points(sq(asq, 2), 4): wy2 = sky_points(sq(asq, 2), 5): wz2 = sky_points(sq(asq, 2), 6)
wx3 = sky_points(sq(asq, 3), 4): wy3 = sky_points(sq(asq, 3), 5): wz3 = sky_points(sq(asq, 3), 6)
sy0 = sq(asq, 6): sx0 = sq(asq, 4): sy1 = sq(asq, 7): sx1 = sq(asq, 4): sy2 = sq(asq, 6): sx2 = sq(asq, 5): sy3 = sq(asq, 7): sx3 = sq(asq, 5)
_MAPTRIANGLE (sx0, sy0)-(sx1, sy1)-(sx2, sy2), sky_image TO(wx0, wy0, wz0)-(wx1, wy1, wz1)-(wx2, wy2, wz2), , _SMOOTH
_MAPTRIANGLE (sx3, sy3)-(sx1, sy1)-(sx2, sy2), sky_image TO(wx3, wy3, wz3)-(wx1, wy1, wz1)-(wx2, wy2, wz2), , _SMOOTH: NEXT asq: RETURN
I didn't try this with yours, I just copied it from one of the games. check the variables to make sure they match!