Posted: 7th Jul 2010 20:23
example code using direct x file, seems to happen on different x files
rem ***********************************************
REM - Setup up the video display
CLS
SET DISPLAY MODE 1024,768,32
REM - Setup up the font
SET TEXT FONT "verdana"
SET TEXT SIZE 14
REM - Setup lighting
SET AMBIENT LIGHT 60
COLOR AMBIENT LIGHT RGB(255,255,255)
HIDE LIGHT 0
MAKE LIGHT 1
COLOR LIGHT 1, 1024, 100, 100
COLOR LIGHT 1, 255, 255, 255
set point light 1,0,0,500
POSITION LIGHT 1, 0, 50, 400
SET LIGHT RANGE 1,1024
SHOW LIGHT 1
REM - Setup camera
sync on:sync rate 60
set camera range 0,10000
autocam off
SET NORMALIZATION ON
REM - Load images
load image "floor.bmp",1
`load image "wall.bmp",2
load image "wall.bmp", 2
load image "sky.bmp",3
load image "grass.bmp",4
load image "wall_with_door.bmp", 5
load image "wall_with_2_door.bmp", 6
REM DISPLAY
remstart
print "the sceenwidth is "+str$(screen width())
do
loop
end
remend
`my code
`FLUSH VIDEO MEMORY
load object "colz.x", 7
SET OBJECT SPEED 7, 6000
SCALE OBJECT 7, 1500, 1500, 1500
texture object 7,7
position object 7, 0, -620, -200
xrotate object 7, -90
yrotate object 7, 190
sync
`end my code
make object plain 1,1280,768
make object plain 2,1280,768
make object plain 3,1280,768
make object plain 4,1280,768
make object plain 5,1280,1280
make object plain 6,1280,1280
texture object 1,6 `wall-left wall
texture object 2,2 `wall-front wall
texture object 3,2 `wall-right wall
texture object 4,5 `wall-rear wall
texture object 5,3 `sky
texture object 6,1 `floor
rem 640
position object 1,-640,0,0
position object 2,0,0,640
position object 3,640,0,0
position object 4,0,0,-640
position object 5,0,340,0
position object 6,0,-340,0
sync
for rot=1 to 6
set object ambient rot,0
set object texture rot,2,0
point object rot,0,0,0
next rot
point camera 0, 0, 0
do
`if keystate(17)=1 then position camera camera position x(0)+5*sin(camera angle y(0)),0,camera position z(0)+5*cos(camera angle y(0))
`if keystate(31)=1 then position camera camera position x(0)-5*sin(camera angle y(0)),0,camera position z(0)-5*cos(camera angle y(0))
`if keystate(32)=1 then position camera camera position x(0)+5*cos(camera angle y(0)),0,camera position z(0)-5*sin(camera angle y(0))
`if keystate(30)=1 then position camera camera position x(0)-5*cos(camera angle y(0)),0,camera position z(0)+5*sin(camera angle y(0))
position camera 0, -100, -605
rotate camera camera angle x(0)+mousemovey()/8,camera angle y(0)+mousemovex()/8,0
sync
loop