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 / Qrotate vs turn object use pivot Bug?

Author
Message
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 7th Jan 2003 02:34
Is it safe to say that if you use turn objects then you wouldn't want to use the rotate command?

I mean use one or the other?

Is there a problem with the fix object pivot command?

I tried using a primitive to test the differences, but I find you can see the errors better if you use an X object...

Please see my code:



Here is a link to the object
http://www.boyar.net/testrotate.zip
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 7th Jan 2003 02:38
rem The code is attached in the zip file:

set window title "Ready the flashlights"
color backdrop rgb(0,0,0)

load object "flashlight.x",10
load sound "cowbell.wav",1
zcats=256

autocam off
move camera -20
pitch camera down 90
move camera 2
pitch camera up 90


rem why is the following move camera operation
rem so different when all I do is press the arrow keys
rem the flashlight does not end up at the top of the screen
rem ????????????
rem move camera 18


do
control camera using arrowkeys 0,1,1
rem turn object left 10,1
flx=object angle x(10)
fly=object angle y(10)
flz=object angle z(10)
set cursor 0,0
print "angles X:";flx;" Y:";fly;" Z:";flz

if inkey$()="s"
inc flx
if flx>360 then flx=1
xrotate object 10,flx
endif
if inkey$()="x"
dec flx
if flx<1 then flx=360
xrotate object 10,flx
endif

if inkey$()="d"
inc fly
if fly>360 then fly=1
yrotate object 10,fly
endif
if inkey$()="c"
dec fly
if fly<1 then fly=360
yrotate object 10,fly
endif

if inkey$()="f"
inc flz
if flz>360 then flz=1
zrotate object 10,flz
endif
if inkey$()="v"
dec flz
if flz<1 then flz=360
zrotate object 10,flz
endif
if inkey$()="w"
fix object pivot 10
t=timer()
play sound 1

repeat
set cursor 0,20
print "Pivot fixed"

until timer()>t+300
endif


if inkey$()="a" then turn object left 10,1
if inkey$()="z" then turn object right 10,1

loop

Login to post a reply

Server time is: 2024-05-18 05:39:58
Your offset time is: 2024-05-18 05:39:58