Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / coding error!!

Author
Message
James Bond
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 25th Jul 2004 17:33
please edit this code for me such that it work correctly with my 3d model
PROBLEM:MY MODEL GOES BELOW EVERYTHING ELSE AND THERE IS A COLLISION ---------PROBLEM TOO ...

http://www.geocities.com/rehansites2/hello.zip

Rem Make sphere
Rem Setup sync
Sync On
Sync Rate 30

Rem Make Cubes and place randomly
For x = 1 to 5
Make object cube x,100
Position object x,Rnd(2000),0,Rnd(2000)
Set object collision to boxes x
Next x

Rem Make sphere
load object "c:\hello.x",10
Position object 10,-100,0,-100


Rem Main 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 Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)

Rem Detect collision
If Object collision(10,0)>0 then position object 10,X#,0,Z#

Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)

Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)

Rem position camera
Position Camera cX#,75,cZ#

Rem point the camera at the player object
Point camera X#,25,Z#

Rem Refresh Screen
Sync

Loop
sarin
21
Years of Service
User Offline
Joined: 20th Mar 2004
Location: nowhere
Posted: 25th Jul 2004 17:54
simple
u just need to add in a: set object collision to boxes 10: and u have it. fixed. Happy Pie!

Sarin
James Bond
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 25th Jul 2004 19:21
and what about that camera problem??

Login to post a reply

Server time is: 2025-05-25 06:58:20
Your offset time is: 2025-05-25 06:58:20