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.

Newcomers DBPro Corner / Limit camera turning.

Author
Message
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 27th Apr 2012 22:59
I am trying to limit camera turning angles to certain values, say I don't want the camera to roll past 10 degrees or pitch past 15 degrees, but as the camera itself rotates the angles returned by "Camera Angle X(1)" and "Camera Angle Z(1)" change. Is there a way to return the angles in reference to the direction the camera is facing instead of the over all map? Code listed below.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 27th Apr 2012 23:23
jumping in here to observe...

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Apr 2012 03:00 Edited at: 28th Apr 2012 03:15
You could put a cube where the camera is, and more cubes to limit the angles. The camera cube rotates with the camera, but the other cubes only move with the camera. Then do a distance check between the camera cube, and the limit cubes. That would be a bit like limiting a mop to a bucket.

EDIT: Better still, just have a inc Counter for left, dec Counter for right, and when you press a key to turn the camera the counter counts up, or down, just limit the counter.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th Apr 2012 14:06
caz=caz
cax=cax


There's absolutely no need to do that. Or are you just making sure that the variable doesn't lose it's current value?

I don't understand what you're trying to do... How can you point a camera in a different direction than where a camera is pointing? Your sentence in my eyes is a paradox.

TheComet

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Apr 2012 18:37 Edited at: 30th Apr 2012 18:38
I was thinking of a Gun Turret, where you can only view where the gun can turn to. Or a human head in a cockpit. Limited turning angles.

CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 30th Apr 2012 19:19
Exactly. I am trying to make a cockpit. As far is caz=caz and czx=czx, if the value is outside of the desired range it keeps the same angle (the limit).
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 2nd May 2012 01:20
Like this?



Maybe?
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 4th May 2012 07:42
Yes. Like that but if you then turn around 180 degrees the values change, don't they?

Login to post a reply

Server time is: 2024-11-22 00:29:27
Your offset time is: 2024-11-22 00:29:27