Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3d surface images
#15
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!
Reply


Messages In This Thread
3d surface images - by james2464 - 11-20-2022, 04:58 AM
RE: 3d surface images - by MasterGy - 12-18-2022, 05:13 PM
RE: 3d surface images - by james2464 - 12-18-2022, 09:02 PM
RE: 3d surface images - by MasterGy - 12-18-2022, 09:19 PM
RE: 3d surface images - by james2464 - 12-18-2022, 09:52 PM
RE: 3d surface images - by james2464 - 12-19-2022, 12:16 AM
RE: 3d surface images - by bplus - 12-19-2022, 01:12 AM
RE: 3d surface images - by mnrvovrfc - 12-19-2022, 10:27 AM
RE: 3d surface images - by james2464 - 12-19-2022, 02:26 AM
RE: 3d surface images - by james2464 - 12-19-2022, 06:01 AM
RE: 3d surface images - by MasterGy - 12-19-2022, 01:16 PM
RE: 3d surface images - by james2464 - 12-19-2022, 09:09 PM
RE: 3d surface images - by MasterGy - 12-19-2022, 09:20 PM
RE: 3d surface images - by james2464 - 12-19-2022, 09:44 PM
RE: 3d surface images - by MasterGy - 12-19-2022, 09:59 PM
RE: 3d surface images - by james2464 - 12-19-2022, 10:13 PM
RE: 3d surface images - by james2464 - 12-20-2022, 12:33 PM
RE: 3d surface images - by MasterGy - 12-20-2022, 01:52 PM
RE: 3d surface images - by james2464 - 12-20-2022, 03:52 PM
RE: 3d surface images - by MasterGy - 12-20-2022, 01:58 PM
RE: 3d surface images - by SMcNeill - 12-20-2022, 03:37 PM
RE: 3d surface images - by james2464 - 12-20-2022, 04:26 PM
RE: 3d surface images - by MasterGy - 12-20-2022, 07:33 PM
RE: 3d surface images - by mnrvovrfc - 12-20-2022, 11:22 PM
RE: 3d surface images - by SMcNeill - 12-20-2022, 11:39 PM
RE: 3d surface images - by james2464 - 12-20-2022, 06:02 PM
RE: 3d surface images - by MasterGy - 12-20-2022, 07:18 PM
RE: 3d surface images - by james2464 - 12-20-2022, 07:42 PM
RE: 3d surface images - by james2464 - 12-21-2022, 04:49 AM
RE: 3d surface images - by james2464 - 12-21-2022, 07:45 PM
RE: 3d surface images - by james2464 - 12-23-2022, 08:28 PM
RE: 3d surface images - by mnrvovrfc - 12-23-2022, 09:09 PM
RE: 3d surface images - by MasterGy - 12-24-2022, 01:39 PM
RE: 3d surface images - by MasterGy - 12-24-2022, 01:55 PM
RE: 3d surface images - by james2464 - 12-24-2022, 05:56 PM
RE: 3d surface images - by james2464 - 12-24-2022, 05:58 PM
RE: 3d surface images - by bplus - 12-24-2022, 06:34 PM
RE: 3d surface images - by james2464 - 12-24-2022, 07:40 PM
RE: 3d surface images - by MasterGy - 12-24-2022, 07:20 PM
RE: 3d surface images - by james2464 - 12-24-2022, 07:39 PM
RE: 3d surface images - by OldMoses - 12-25-2022, 12:25 AM
RE: 3d surface images - by james2464 - 12-26-2022, 05:13 PM
RE: 3d surface images - by james2464 - 12-26-2022, 05:19 PM
RE: 3d surface images - by MasterGy - 12-27-2022, 10:46 AM
RE: 3d surface images - by james2464 - 12-27-2022, 09:17 PM
RE: 3d surface images - by MasterGy - 12-27-2022, 10:53 AM



Users browsing this thread: 14 Guest(s)