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 Professional Discussion / Why is this happening?

Author
Message
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 24th Dec 2010 04:05
When i use the camera to follow the player, i cant turn around fully. i get to 180 degrees and it starts over at 0 degrees? sorry for the sounds and images, you will have to delete the cmd to test it.


sound = 0
sync on
sync rate 60
make object cube 1,25
make light 1
set light range 1,90000
sync on
sync rate 0
message = 0
make object cube 2,25
load image "floor.png",2
make matrix 1,500,500,50,50
position matrix 1,0,-15,0
prepare matrix texture 1,2,1,1
load music "jumpstyle.mp3",1
Y#=0
set object collision on 1
set object collision to boxes 1
do
texture object 2,2
position object 2,0,0,100
X=object position X(1)
Y=object position Y(1)
set camera to follow X,Y,Z,AY#,100,50,1,0
Z=object position Z(1)
AY#=object angle Y(1)
AX#=object angle X(1)
AZ#=object angle Z(1)
if rightkey()=1 then turn object right 1,3
if leftkey()=1 then turn object left 1,3
if upkey()=1 then move object 1,3
if downkey()=1 then move object 1,-3
print "X:", object position X(1)
print "Y:", object position Y(1)
print "Z:", object position Z(1)
center text 0,0,"X"
center text 0,0,"Y"
center text 0,0,"Z"
sync
loop

onhcet d(-_-)b techno
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 24th Dec 2010 04:46 Edited at: 24th Dec 2010 04:48
Welcome to the forum
Please place your code on a code box



Also, please indent your code, it makes it much easier to read

well, the issue is the way set camera to follow works with DBPro's angle system

DBPro uses euler angles, with both local and world rotations, things can get confusing. If you had done a print AY# for the angle used in the set camera to follow, you would have seen that the angle went from 0-90, then from 90-0, kind of messed up really, not your fault.

If you will use these 3 line changes for now, it will work


Good Luck with your program!
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 24th Dec 2010 05:46
HAHA I LOVE YOU! Thanks for the code snipit thing too becuase i knew what it was but didnt know how to use it. thank you so much =D

onhcet d(-_-)b techno
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 24th Dec 2010 05:46
HAHA I LOVE YOU! jk, naw but im really happy! Thanks for the code snipit thing too becuase i knew what it was but didnt know how to use it. thank you so much =D

onhcet d(-_-)b techno

Login to post a reply

Server time is: 2026-07-21 20:35:14
Your offset time is: 2026-07-21 20:35:14