Hmmm I\'ve looked at tons of collision tutorials but i still can\'t understand how to do sliding collision using math collision(I want math cause my computer really isn\'t THAT fast to use the built-in commands lol) Anyways...here is my code
rem Make a 3D landscape
MAKE MATRIX 1,45000.0,36000.0,25,25
rem Load grass floor bitmap into image
LOAD BITMAP \"GRASS15.bmp\",1
Get Image 1,0,0,256,256
Delete Bitmap 1
rem Texture landscape
PREPARE MATRIX TEXTURE 1,1,1,1
Rem Load Wall Texture
Delete Image 1
rem Activ23ate manual syncronization and hide mouse
SYNC ON
Sync Rate 1000
HIDE MOUSE
AUTOCAM OFF
rem Load and Loop Music
Load Music \"Dance of Darkness.mid\",1
Play Music 1
Loop Music 1
rem Set Distance and Color of Fog
Fog On
Fog Color RGB(256,256,256)
Fog Distance 10000
Backdrop On
Color Backdrop RGB(256,256,256)
Rem Create Characters
`Player
Load Object \"Walk.3DS\",10
Position Object 10,6000,Y#,6000
YRotate Object 10,180
Scale Object 10,250,250,250
Set Camera Range 1,45000
RemStart
Character Information Array Settings
Charstat#(1) = Health Charstat#(7) = % Chance to Hi Target
Charstat#(2) = Experience Charstat#(8) = Damage
Charstat#(3) = Strength Charstat#(9) = Armor Class
Charstat#(4) = Agility Charstat#(10)= Level
Charstat#(5) = Energy
Charstat#(6) = Vitality
Remend
Gravity# = 6
VS# = 10
Remstart
-------------------------------------------------------------------------------
WALLS FOR THE DUNGEON
-------------------------------------------------------------------------------
Remend
Make Object Box 123,10,700,27000
Position Object 123,2995,350,19500
Make Object Box 124,10,700,4243
Position Object 124,4500,350,4500
Yrotate Object 124,135
Make Object Box 125,9000,700,10
Position Object 125,10500,350,2995
Make Object Box 126,10,700,4243
Position Object 126,16500,350,4500
YRotate Object 126,225
Make Object Box 127,3000,700,10
Position Object 127,19500,350,6000
Make Object Box 128,10,700,4243
Position Object 128,22500,350,4500
YRotate Object 128,135
Make Object Box 129,3000,700,10
Position Object 129,25500,350,3000
Make Object Box 130,10,700,4243
Position Object 130,28500,350,4500
YRotate Object 130,225
Make Object Box 131,10,700,3000
Position Object 131,30000,350,7500
Make object Box 132,3000,700,10
Position Object 132,31500,350,9000
Make Object Box 133,10,700,4243
Position Object 133,34500,350,7500
YRotate Object 133,135
Make Object Box 134,6000,700,10
Position Object 134,39000,350,6000
Make Object Box 135,10,700,4243
Position Object 135,40500,350,7500
YRotate Object 135,135
Make Object Box 136,10,700,3000
Position Object 136,39000,350,10500
Make Object Box 137,10,700,2122
Position Object 137,38250,350,12750
YRotate Object 137,135
Make Object Box 138,10,700,2122
Position Object 138,38250,350,14250
YRotate Object 138,225
Make Object Box 139,10,700,2122
Position Object 139,38250,350,15750
YRotate Object 139,135
Make Object Box 140,10,700,2122
Position Object 140,38250,350,17250
YRotate Object 140,225
Make Object Box 141,10,700,3000
Position Object 141,39000,350,19500
Make Object Box 142,10,700,4243
Position Object 142,40500,350,22500
YRotate Object 142,225
Make Object Box 143,6000,700,10
Position Object 143,39000,350,24000
Make Object Box 144,10,700,4243
Position Object 144,34500,350,22500
YRotate Object 144,225
Make Object Box 145,6000,700,10
Position Object 145,30000,350,21000
Make Object Box 146,10,700,4243
Position Object 146,25500,350,19500
YRotate Object 146,225
Make Object Box 147,6000,700,10
Position Object 147,21000,350,18000
Make Object Box 148,10,700,6000
Position Object 148,18000,350,15000
Make Object Box 149,3000,700,10
Position Object 149,19500,350,12000
Make Object Box 150,10,700,5750
Position Object 150,21000,350,14875
Make Object Box 151,3000,700,10
Position Object 151,22500,350,17750
Make Object Box 152,10,700,5750
Position Object 152,24000,350,14875
Make Object Box 153,10,700,4243
Position Object 153,22500,350,10500
YRotate Object 153,225
Make Object Box 154,5750,700,10
Position Object 154,18125,350,9000
Make Object Box 155,10,700,15000
Position Object 155,15250,350,16500
Make Object Box 156,17750,700,10
Position Object 156,24125,350,24000
Make Object Box 157,10,700,3000
Position Object 157,33000,350,25500
Rem Load Wall Texture
Load Bitmap \"brick06.bmp\",7
Get Image 7,0,0,256,256
Delete Bitmap 7
For T = 123 TO 157
Texture Object T,7
Next T
rem Begin loop
DO
Rem Store Object angle Y in aY#
aY# = Object angle Y(10)
Rem Control input for camera
If Upkey()=1 then Move object 10,-10
If Downkey()=1 then Move Object 10,+10
If Upkey()=1 and Shiftkey()=1 then Move Object 10,-50
If Downkey()=1 and Shiftkey()=1 then Move Object 10,+50
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
Y# = Get Ground Height(1,X#,Z#)
pY# = Object Position Y(10)
If Spacekey()=1 or Object Position Y(10) > 0 Then VS#=VS#-.5
If Object Position Y(10)<Y# then Position Object 10,X#,Y#,Z#
If Object Position Y(10)>0 Then Position Object 10,X#,pY#+Gravity#,Z#
If Object Position Y(10)>0 and Spacekey()=0 Then Gravity# = Gravity#-.3
If Spacekey()=1 then Gravity#=Gravity#-.3
If Object Position Y(10) = 0 and Spacekey()=0 then Gravity#=6
If Object Position Y(10) = Y# and Spacekey()=0 then VS# = 10
rem Character Animations
If Upkey()=1 then Loop Object 10, 5, 25
If Upkey()=0 then Stop Object 10
If Upkey()=0 then Loop Object 10, 6, 1
If Downkey()=1 then Loop Object 10, 5, 25
If Upkey()=1 then Set Object Speed 10,7
If Upkey()=1 and Shiftkey()=1 then Set Object Speed 10,14
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#+360,700)
cX# = Newxvalue(X#,aY#+360,700)
Rem position camera
Position Camera cX#,y#+700,cZ#
Rem point the camera at the player object
Point camera X#,Y#+50,Z#
If Object Position Y(10) < 0 then Position Object 10,X#,0,Z#
If Object Position X(10) < 3050 then Position Object 10,3050,Y#,Z#
If Object Position Z(10) < 3050 then Position Object 10,X#,Y#,3050
If Object Position X(10) < 4500 AND Object Position Z(10) < 4500 then Position Object 10,4500,Y#,4500
Set Cursor 0,0
Text 100,100,Str$(Screen FPS())
posx = Object Position X(10)
posy = Object Position Y(10)
posz = Object Position Z(10)
Print \"X Pos :[\";posx,\"]\"
Print \"Y Pos :[\";posy,\"]\"
Print \"Z Pos :[\";posz,\"]\"
rem Refresh screen
SYNC
rem End loop
Loop
Fancy isn\'t it
Could someone please tell me how to get the walls that are YRotated and my character to do sliding collision. I don\'t want someone to do it for me....just show me how I should check for distance and collision of the objects.
Thanks in advance,
Ragnarok