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 / Camera Lock and Camera Wobble

Author
Message
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 30th Jan 2014 21:04
Hello community!

Please help me with this dilema!

How can i lock the camera's orientation when reaching 90 degrees like when i want to view the sky i want to stop at 90 degrees not rotating over and over again. Same as when i want to look on the ground to stop at 90 degrees!




Also please if you can tell me how can i make my camera animating as if its moving/walking animation.

Thank You!

Alex Matei CEO
www.alexmatei.com
Southside Games
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 30th Jan 2014 21:27 Edited at: 30th Jan 2014 21:35
I can answerer the first one for you.

Basically you keep track at were it's at. and if it goes over you re-adjust it. I like to use a float.






I think the x axis is were up and down come into play. if not just swap it out in z.

as for the second I have not played with that kind of camera yet, you mean like in Gears of War were when you sprint the camera shakes?

I think you would use something with the "CURVEANGLE(Destination Value, Current Value, Speed Value)" command with a random number. try using the above command were the Destination Value is a combination of the players current Y angle added with a random value of how intense you want the "camera jerk" to be. then every second get a new random "jerk" value, but invert it. "meaning make it a negative instead of a positive. then just alternate."

if you get such a camera shake working please let me know. I would love to see it in DBP
ShellfishGames
11
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 30th Jan 2014 21:50 Edited at: 30th Jan 2014 21:53
Try this out:



I tried to explain everything in the code, but if something's unclear just ask. The method is actually really simple - you just separate the actual camera position from an offset which is responsible for the animation. The rest is a bit trigonometry and tweaking of the values and angles.

MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Feb 2014 12:35
Sorry for the delay! Thank you all for the responses it answers my question!

Thank You again!

Alex Matei CEO
www.alexmatei.com
ShellfishGames
11
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 2nd Feb 2014 13:14
Note that MonoCoder enhanced the walking effect here: http://http://forum.thegamecreators.com/?m=forum_view&t=209759&b=6

Really gives it the Mirror's Edge kind of feel.

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Feb 2014 13:54
Hi there
Little example here



I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Feb 2014 20:07
Hey Chafari! Good to see you again! Very nice code indeed i tested out it worked fine! All the codes here where very good i can't thank enough!

Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2024-04-27 07:38:25
Your offset time is: 2024-04-27 07:38:25