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.

Code Snippets / [DBP] RollCamera for All Axis

Author
Message
puppysss
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 9th Nov 2009 03:09
If you set only roll camera + rotate camera,when rotate y-axis,
camera will reverse.
But Zrotate camera (Zero) + Roll Camera work very well.
It helps who want to make perfect roll camera.
I wish It helps your projects.



DEFCON CRISIS comming soon 2009~~!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Nov 2009 14:32
Uhm, I think you missed the main loop? LOCK!

TheComet


Make the paths of your enemies easier with WaypointPro!
puppysss
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 9th Nov 2009 15:16
Sorry That's my mistake,Do You Want full source code?
Here is it!



DEFCON CRISIS comming soon 2009~~!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Nov 2009 19:51
I have to disappoint you again...

set camera fov 72

This number is in radians, not in degrees. You can calculate the degrees with this formula:

fov#=(3.14/180)* degrees#
degrees#=(3.14/180)/fov#


so 72 radians would equal about 7.8 degrees, which is quite small, I would imagine.

Secondly, you forgot the "sync" command, which should refresh the screen every loop.

You can totally forget this line:

if Upkey() = 0 and Downkey() = 0 Then Move Camera 0.0

Because the camera won't move anyway if you don't push any button. The same for the next line:

If Keystate(DIK_A)=0 and Keystate(DIK_D)=0 Then Roll Camera Right 0

Nice use of the constants.

TheComet


Make the paths of your enemies easier with WaypointPro!
puppysss
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 10th Nov 2009 10:19
Oh So Sorry!
I think I make this code very simply.
However I learned more knowledge that I didn't thought like Fov is Radian and blah blah~!
Thank you So Much!!

DEFCON CRISIS comming soon 2009~~!
Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 13th Nov 2009 07:07
@ thecomet

Most angle values in DBPro are in degrees, not radians, and set camera fov is no exception. Try running this code:

that code sets the fov using degrees. Now try this code:

That uses radians, and it's obvious that it doesn't have the desired results.

puppysss
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 14th Nov 2009 13:59
Wow Thanks!
It is very useful & helpful!!

DEFCON CRISIS comming soon 2009~~!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Nov 2009 01:50
That's very odd... In DBC you have to use radians. Why would Lee change it?

TheComet


Make the paths of your enemies easier with WaypointPro!

Login to post a reply

Server time is: 2024-05-04 23:16:40
Your offset time is: 2024-05-04 23:16:40