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 / Rotate Camera with decimals i.e 0.1 (DBC)

Author
Message
Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 8th Feb 2006 23:31
I want to rotate the camera in increments less than 1 degree as below

if inkey$()="1" then rotate camera x#,y,z:x#=x#+0.1

I understand you use # for a decimal but rotate camera doesn't seem to like it...

How can I therefore rotate the camera more slowly rather than adding a loop just to slow it which will slow my main engine..

Also kinda had a related question here

YROTATE OBJECT 1,Wrapvalue(object angle y(1) + n)
n=n+0.1

where I was told WRAPVALUE would allow less than a degree incrments here... any help to both these question pls ?>
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Feb 2006 00:25
Hmm. The best I can do is show you the free flight example. This will work with floating points if you add them. It is how I made my own space game, although I changed a few things. Basically you position an object where the camera would be, and you move the object, and not the camera. Then you put the camera back on the object.



Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 9th Feb 2006 00:57
Thx, but not really what I'm, looking for...

If you can image a ship in space and the inertia casuign the craft to continously roll or pitch, then what I am trying to do is increment the camera rotatation in increments less than 1 degree... for my universe to look realisitic and rotate the back ground and planets etc.I have found the camera the best way of doing that... therefore lookign for a way to rotate camera in x,y,z direction less than 1 degree i.e x=x+0.01 etc...

if inkey$()="3" then rotate camera x,y,z:y=y+0.01

only seems to work if y=y+1

so does it work with decimal increments I guess is what I am after..

Reason, rotations when put in a loop are just too fact and adding a loop juts top slow down, slows the whole sim.

THx
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Feb 2006 09:30
Yes that source works with decimal increments. I said it works with floating points in my post.

smallg
Valued Member
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 9th Feb 2006 11:02 Edited at: 9th Feb 2006 11:06
the reason yours was failing is really quite simple u needed a # after the variables, like so...


[edit] ok just re-read the first post (originally read the 3rd) and realised u already tried using #, well very odd, it works for me...

life's one big game
spec= 1.6ghz, 512mb ram, 128mb gpu, directx 9.0c, dbpro and classic
Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 9th Feb 2006 21:29
Thx Smallg, thats works... strange

Login to post a reply

Server time is: 2025-05-23 12:54:15
Your offset time is: 2025-05-23 12:54:15