Hi There,
I am trying to create a simple program that has a 'space' backdrop using a Skysphere. Within this scene I want to construct a 'planet' by making a 3D sphere.
At the moment I can load and see the Skysphere OK, and rotate the camera to look around. However the planet 'sphere' is not present and I'm not sure how to fix this problem.
Any help/suggestions you could provide would be amazing. Thanks.
Details :
I am using the 'Space Station' sky-sphere from the Dark-Matter Package.
Source code is below:
rem Initial settings
sync on : sync rate 100
backdrop off : hide mouse
rem Select font
set text font "arial" : set text size 16
set text to bold : set text transparent
rem Loading prompt
sync : center text screen width()/2,screen height()/2,"LOADING" : sync
rem Setup camera
set camera range 0.1,5000
autocam off
SkyObj=1 : load object "C:\Program Files\The Game Creators\Dark Basic Professional\Projects\models\space\ss.x",SkyObj
rem Setup sky model (space background)
set object SkyObj,1,0,0,0,0,0,0
scale object SkyObj,30,30,30
rem Make wire sphere (Planet)
make object sphere 10,5000
set object 10,1,0,0
position object 10,0,0,0
color object 10, rgb(255,0,0)
set object emissive 10,rgb(255,0,64)
rem Game loop
do
rem Control game elements
gosub _control_player
rem Update screen
sync
rem End loop
loop
rem End program
end
_control_player:
rem Control player direction
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
rem Control player movement
cx#=camera angle x(0) : cy#=camera angle y(0)
if upkey()=1 then xrotate camera 0,0 : move camera 0,0.2 : xrotate camera 0,cx#
if downkey()=1 then xrotate camera 0,0 : move camera 0,-0.2 : xrotate camera 0,cx#
if leftkey()=1 then yrotate camera 0,cy#-90 : move camera 0.2 : yrotate camera 0,cy#
if rightkey()=1 then yrotate camera 0,cy#+90 : move camera 0.2 : yrotate camera 0,cy#
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<335 then xrotate camera 0,335
return