since no one offered to share code for this thread, i somehow put together code on my own.
here goes..
`--- set up screen
Sync On
Sync Rate 30
hide mouse
`- make it dark outside
set ambient light 1
`--- Create Matrix
Make Matrix 1,2000,2000,50,50
`--- Create House
`- wall with door
`------- right section
MAKE OBJECT BOX 1, 100,100,4
Color object 1, RGB(51,152,255)
POSITION OBJECT 1, 600,50,400
`------- left section
MAKE OBJECT BOX 2, 100,100,4
Color object 2, RGB(51,152,255)
POSITION OBJECT 2, 800,50,400
`------- middle top section
MAKE OBJECT BOX 3, 100,20,4
Color object 3, RGB(51,152,255)
POSITION OBJECT 3, 700,80,400
`- left side wall with window
`------- right section
MAKE OBJECT BOX 4, 4,100,100
Color object 4, RGB(51,152,255)
POSITION OBJECT 4, 550,50,352
`------- left section
MAKE OBJECT BOX 5, 4,100,100
Color object 5, RGB(51,152,255)
POSITION OBJECT 5, 550,50,202
`------- middle top section
MAKE OBJECT BOX 6, 4,30,50
Color object 6, RGB(51,152,255)
POSITION OBJECT 6, 550,85,277
`------- middle bottom section
MAKE OBJECT BOX 7, 4,30,50
Color object 7, RGB(51,152,255)
POSITION OBJECT 7, 550,15,277
`- right side wall
MAKE OBJECT BOX 8, 4,100,250
Color object 8, RGB(51,152,255)
POSITION OBJECT 8, 850,50,277
`- back wall
MAKE OBJECT BOX 9, 397,100,4
Color object 9, RGB(51,152,255)
POSITION OBJECT 9, 650,50,154
`- ceiling/roof
MAKE OBJECT BOX 10, 497,4,324
Color object 10, RGB(51,152,255)
POSITION OBJECT 10, 630,99,295
`- floor
MAKE OBJECT BOX 11, 497,4,324
Color object 11, RGB(51,204,255)
POSITION OBJECT 11, 630,2,295
`--- Room Objects
`- table top
MAKE OBJECT BOX 12, 54,2,54
Color object 12, RGB(102,0,0)
POSITION OBJECT 12, 630,32,295
`- table base
MAKE OBJECT BOX 13, 5,30,5
Color object 13, RGB(51,204,255)
POSITION OBJECT 13, 630,15,295
`- ceiling light inside the house
make light 1
set point light 1,720,55,280
color light 1,RGB(204,255,102)
`--- light fixture
make object sphere 99, 20
Color object 99, RGB(51,152,255)
POSITION OBJECT 99,720,100,280
`--- Extras
`- pillar 1
`------- ( cyl# is for the object's number and cylLoc# is for the location on the Y axis )
cyl#=20
cylLocY#=10
for x = 20 to 28
MAKE OBJECT CYLINDER cyl#, 10
Color object cyl#, RGB(51,152,255)
POSITION OBJECT cyl#, 395,cylLocY#,405
cyl#=cyl#+1
cylLocY#=cylLocY#+10
next x
`- pillar 2
cyl#=30
cylLocY#=10
for x = 30 to 38
MAKE OBJECT CYLINDER cyl#, 10
Color object cyl#, RGB(51,152,255)
POSITION OBJECT cyl#, 395,cylLocY#,305
cyl#=cyl#+1
cylLocY#=cylLocY#+10
next x
`- pillar 3
cyl#=40
cylLocY#=10
for x = 40 to 48
MAKE OBJECT CYLINDER cyl#, 10
Color object cyl#, RGB(51,152,255)
POSITION OBJECT cyl#, 395,cylLocY#,205
cyl#=cyl#+1
cylLocY#=cylLocY#+10
next x
`--- Preset Camera locations for startup
X#=700
Y#=0
Z#=250
`----------------------------------------------------------------
`--- MAIN loop
`----------------------------------------------------------------
do
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
`--- Control input for camera ( keyboard up/down/left/right or W S A D keys )
`------- keystate(17) = W, keystate(31) = S, keystate(30) = A, keystate(32) = D
If Upkey()=1 or keystate(17)
XTest# = Newxvalue(X#,CameraAngleY#,10)
ZTest# = Newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1 or keystate(31)
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-180),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Leftkey()=1 or keystate(30)
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1 or keystate(32)
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#+90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
`--- Mouse Look inverted ( for not inverted, remove the - from the second line )
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,-OldCamAngleX#,24)
`--- Keep camera at person view level
Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+40,Z#
`--- Refresh Screen
Sync
loop
i managed to get some helpful information from the
following tutorial.
for some odd reason, i could not manage to get the collision with the objects to work properly with the mouse view in the above code, but that is another homework project for me and maybe more questions for this forum.
thank you all for the replies to this thread.
p.s. CoughMist, those .X files do load quicker, and wow, much better than making and using boxes all over the place, roflmao, although it does help when designing "
the matrix".