Nice little program there
I've made a spaceship that everyone is free to use if they can't be bothered to make their own
gosub make_ship
`display
sync on
for y=1 to 360
yrotate object 1,y
xrotate object 1,y
sync
next y
END
`---------------------------
` GOSUBS
`---------------------------
make_ship:
`make texture
ink rgb(80,80,80),rgb(95,95,95)
cls
line 0,50,100,50
line 50,0,50,100
line 30,0,30,26
line 40,0,40,26
line 60,0,60,26
line 70,0,70,26
box 0,0,100,10
`details
ink rgb(87,85,90),0
for y = 2 to 8 step 2
line 0,y,100,y
next y
for x = 33 to 63 step 10
box x,12,x+4,24
next x
box 30,75,48,80
box 52,75,70,80
`lights
ink rgb(240,240,160),0
for x = 30 to 70 step 3
box x,30,x+1,33
box x,60,x+1,63
box x,67,x+1,70
next x
get image 1,0,0,100,100
`make ship
make object sphere 1,10
scale object 1,100,15,100
texture object 1,1
yrotate object 1,180
fix object pivot 1
RETURN
[edit]
I've been working on a solar system simulation.
The sun is so huge you can't see the other planets!
use UP and DOWN to zoom the camera (hold shift or space for faster zoom)
Press Control to track planets.
remstart
Solar system is at 1:1000 scale
remend
set display mode 1024,768,32
hide mouse
sync on : sync rate 0
DIM body#(10,2)
DIM body$(10)
mercury=1 : venus=2 : earth=3 : mars=4 : jupiter=5 : saturn=6 : uranus=7 : neptune=8 : pluto=9 : sun=10
size=0 : orbit=1 : colour=2
`diameters
body#(sun,size)= 1390
body#(mercury,size)= 0004.88
body#(venus,size)= 0012.1036
body#(earth,size)= 0012.7563
body#(mars,size)= 0006.794
body#(jupiter,size)= 0142.984
body#(saturn,size)= 0120.536
body#(uranus,size)= 0051.118
body#(neptune,size)= 0049.532
body#(pluto,size)= 0002.274
`orbit radii
body#(sun,orbit)= 0
body#(mercury,orbit)= 57910
body#(venus,orbit)= 108200
body#(earth,orbit)= 149600
body#(mars,orbit)= 227940
body#(jupiter,orbit)= 778330
body#(saturn,orbit)= 1429400
body#(uranus,orbit)= 2870990
body#(neptune,orbit)= 4504000
body#(pluto,orbit)= 5913520
`colours
body#(sun,colour)=rgb(255,200,0)
body#(mercury,colour)=rgb(80,80,80)
body#(venus,colour)=rgb(255,220,100)
body#(earth,colour)=rgb(50,100,140)
body#(mars,colour)=rgb(200,100,0)
body#(jupiter,colour)=rgb(180,140,0)
body#(saturn,colour)=rgb(200,150,150)
body#(uranus,colour)=rgb(150,150,255)
body#(neptune,colour)=rgb(90,90,180)
body#(pluto,colour)=rgb(180,170,200)
`names
body$(sun)="* Sun"
body$(mercury)="- Mercury"
body$(venus)="- Venus"
body$(earth)="- Earth"
body$(mars)="- Mars"
body$(jupiter)="- Jupiter"
body$(saturn)="- Saturn"
body$(uranus)="- Uranus"
body$(neptune)="- Neptune"
body$(pluto)="- Pluto"
`make the solar system
For cb=1 to 10
make object sphere cb,body#(cb,size)
color object cb,body#(cb,colour)
Next cb
set camera range 1,10000000
`color backdrop 0
camdist=20
sel=0
DO
day=wrapvalue(day+1)
u=upkey() : d=downkey() : space=(spacekey()*9)+1 : shift=(shiftkey()*99)+1
inc camdist,(u-d)*(space+shift)
`jump to planet
if controlkey()=1 then ss=1
if ss=1 > controlkey()
ss=0
inc sel,1
if sel>9 then sel=0
camdist=body#(sel,size)*5
endif
for p = 1 to 10
if object exist(p)=1
position object p, sin(day)*body#(p,orbit), 0, cos(day)*body#(p,orbit)
if object in screen(p)=1 then text object screen x(p),object screen y(p)-5,body$(p)
endif
next p
if sel>0
position camera sin(day)*(body#(sel,orbit)+camdist), 0, cos(day)*(body#(sel,orbit)+camdist)
else
position camera 0,0,camdist
endif
point camera 0,0,0
text 0,0,"Currently Tracking: " + body$(sel)
sync
LOOP
Any tips would be great, I really need to improve my 3D stuff.
"You must be someone's friend to make comments about them." - MySpace lied.
