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 / Reseting Camera Orientation Help Plz

Author
Message
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Feb 2005 08:42
hey everyone,
Is there a way to reset the camera's orientation to normal after rotating it on the x or z axis? Also if u turn while rotated at any angle it will mess up the orientation even after u rotate back and u will be tilted sideways, so is there someway i could reset the orientation to normal?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Feb 2005 08:54
If the angles are confusing you, then use this method: Create a hidden dummy object with the orientation that you want as your defualt orientation. Then, when you want to reset your camera, use 'set camera to object orientation' to allign it with the dummy object.


Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Feb 2005 09:20
If it is tilted sideways then rotate the z axis to 0. Rotating the x axis to 0 will make you look straight ahead if it is looking up or down. And the y axis value depends on which way you want to look from side to side (0 being default straight ahead). So rotate camera 0,0,0 will reset it to the default x,y,z orientation. Or use the method Ric stated.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Feb 2005 10:23
0k, thanks, but while trying these methods, i found that:
if keystate(21)=1
xrotate camera -1
endif

Will only face the camera down at a 1 degree angle and will not continuously rotate the camera

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Feb 2005 10:27
Try Pitch Camera Down 1
Or Pitch Camera Up -1

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Feb 2005 11:57
ok, ill try that thanks

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Feb 2005 16:50
Or try

if keystate(21)=1
xrotate camera camera angle x()-1
endif

The angles don't add by themselves like that. When you use them it will rotate the camera to whatever angle you choose. So you have to tell it to use it's current angle - 1

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Feb 2005 22:42
@LIT: not sure what u mean sry

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2005 00:50
All 3d angles in DBP are different than you might think when using the rotate commands. When you use the rotate, xrotate, yrotate, and zrotate commands they rotate your object to the angle you tell it to. Not the angle that your object already is plus or minus what you tell it. So if you want it to look down by using the rotation commands you have to tell it the angle it already is minus how far down you want it to look. If you want to look up you tell it to rotate the angle your object already is plus how much you want to look up.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 13th Feb 2005 06:19
ok, well this might fit into that, but when i try using the commands it works fine but if i hit "r" to reset it resets the camera orientation, but only until i press a key that rotates the camera, then it jumps back to what it was, how would i fix this?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2005 09:59
Sounds like you have conflicting rotation commands in your code. Can you post an example? If not I'll make an example of mouselook with pressing r to reset the view to default.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 13th Feb 2005 11:06
sure ill post the control part of the code, here it is:


Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2005 21:13
I'll make an example. The turn, pitch, and roll commands seem to mess up the return angles on the objects and camera. It this a FPS or 3rd PS. Does the camera have mouselook or just keyboard control?

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 13th Feb 2005 22:29
It's an RPG, but very free one, and right now only keyboard control, everthing thats in the control section is right there. The pitching and the rolling wont be part of the game, but im using them right now to try to make it easier to edit and see things in my world

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2005 23:20
There must be something else conflicting in your code. This works.



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 13th Feb 2005 23:45
no, try getting the camera disoriented by a few rotations and turns so ur kinda sideways then press R then press left or right key

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 05:56
can u try that plz?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Feb 2005 06:35 Edited at: 14th Feb 2005 06:46
Works perfectly here?

[edit]
Is it possible you are just moving closer or farther away fro mthe matrix making it look like it is not resetting for you? Try this code. It does the same thing but repositions the camera 10 units above the matrix when resetting as well as putting all 3 angles to 0



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 08:46
still does it , ok try pressing "h" then press "r" then press the left key, it jumps to the position it was in before u pressed "r"

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Feb 2005 10:19
Did you make a new project and run just my code? It works fine here. I have rotated all sorts of ways moving and not moving and when I press r I can start all over again.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 10:37
hmm...yeah i put it in a new project, even after u move after u hit "r" it doesnt jump?, even if u press the left/right arrow keys, then reset, then press left/right arrow keys, it jumps back to what it was.

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Feb 2005 11:24
Works fine here. Strange.
When I move and rotate then press r it jumps back to default 0,0,0 (resets all angles to 0) and repositions the object 10 units above the matrix just so you can see what direction you are looking. When I press the rotation keys it doesn't jump back to before I reset it. I just start rotating like when the program first loaded. We must be misunderstanding each other or something is screwy.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 11:48
yeah, thats wierd, i tried to explain so u wouldnt misunderstand, and gave step-by-step instructions, and i think u followed them, so i dont think its that. idk what it could be...

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Feb 2005 11:58
I don't know I stopped using the turn, pitch, and roll commands long ago as they mess with the object angles (or used to they seem alot better now). I only use the rotate commands. But that code seems to be working to me.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 12:02
ok, ill try the rotate commands thanks, but i tried
if keystate(21)=1
xrotate camera 1
endif
if keystate(35)=1
xrotate camera 1
endif

but this only rotates the camera down that amount of degrees instead of slowly rotating as long as the key is being pressed

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Feb 2005 14:07
yeah remember you have to add the current angle to that movement

xrotate camera camera angle x()+1

and

xrotate camera camera angle x()-1

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2005 22:28
o, ok, thats what i thought, but since theres no, "position camera angle commands", i wasnt sure how to do this, cause i didnt think it would update.

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.

Login to post a reply

Server time is: 2024-11-27 22:33:21
Your offset time is: 2024-11-27 22:33:21