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 / Toggle between 1st & 3rd person camera views...

Author
Message
M4v3r1ck
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location:
Posted: 13th Nov 2006 01:21
So, I'm tryin' to get a section to toggle between camera views, for 1st 'n 3rd. The toggle key bein' v...And I can't get it to work. So, someone wanna' help a n00b?


I was doing the FPS tutorial. I'm understanding a lot more now. So, thanx Ruccus.

~~~~~~
Clan Leader of Gamer-Society.
Vampiric
18
Years of Service
User Offline
Joined: 30th Oct 2006
Location:
Posted: 13th Nov 2006 16:46 Edited at: 13th Nov 2006 16:46
here's the base of the code that would work



All bow down to evil
slicer 4 ever
18
Years of Service
User Offline
Joined: 11th Jul 2006
Location: currently: planet gamma3295
Posted: 13th Nov 2006 18:14
also to ensure it doesn't constantly go back and forth add this into the code:



that well ensure that if you hold down v it won't constantly go back and forth

my smiles love me =-)=-)=-)(-=(-=(-=
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Nov 2006 18:22 Edited at: 13th Nov 2006 21:27
Vamp, all you've done is restated what he had in his code, except yours doesnt do anything.

Maverick, go through this code, see if it helps;


Its untested, Im just having lunch right now at school so there may be a bug or two in it. When I get home Ill check it over, but it should work.

- RUC'

slicer 4 ever
18
Years of Service
User Offline
Joined: 11th Jul 2006
Location: currently: planet gamma3295
Posted: 13th Nov 2006 18:30 Edited at: 13th Nov 2006 18:39
RUCCUS going over that code i noticed that when the cam mode is active your constantly moving the camera back and up here i modified it so it now works like your saying:



also ruccus the person was asking how to get it to switch between the 2 modes

so those i noticed that M4v3r1ck you use camera1 and camera 2 so those try adding this into your code:




also modify you second if statement from camera2 = 1 to camera1 = 2
as that may be another of your problems so in all it should look something like this:



also i have dbc so don't blame me if some of these commands are right or not

my smiles love me =-)=-)=-)(-=(-=(-=
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Nov 2006 20:38 Edited at: 13th Nov 2006 21:28
The camera constantly moves back and up because at the same time, its constantly positioned at the player's coordinates and rotated to the player's angle. Thats what makes it constantly follow behind the player object every loop.

And I showed how to switch between the two modes, it says pressing the 1 key will set the cam mode to first person, and pressing the 2 key will set it to third person.

Did you even test it before debugging it?

<EDIT>

Just got home, there was only a minor bug with the keystate checking, fixed it to be simpler now along with adding some text to inform the user as to how to change modes.

</EDIT>

slicer 4 ever
18
Years of Service
User Offline
Joined: 11th Jul 2006
Location: currently: planet gamma3295
Posted: 13th Nov 2006 22:08
o ok well then nvm but wouldn't position the camera than moveing it again slow it down in the long run

my smiles love me =-)=-)=-)(-=(-=(-=
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Nov 2006 22:50
Thats the generic method for doing third person cam views without using trig or limbs. You need to position the camera at the object's position so that when you move it backwards, it'll follow behind the player object properly. Try taking the position camera part and move camera part out and see what happens.

Ofcourse there's other methods, you could use limbs to position the camera, trig to figure out the cam's new position and angle, you could even use the SET CAMERA TO FOLLOW command, though I prefer writing commands like that myself.

M4v3r1ck
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location:
Posted: 15th Nov 2006 09:38
Hmm...Your camera thing worked Ruccus thanx. But is there a way to make it toggle using the same key?

Also, I had tried the set camera to follow with little success. So, my guess would be I was using it inappropriately...It's hard bein' a noob...

~~~~~~
Using: DBPro
M4v3r1ck
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location:
Posted: 15th Nov 2006 09:51
Can I even post right now???

~~~~~~
Using: DBPro

Login to post a reply

Server time is: 2024-11-26 08:56:39
Your offset time is: 2024-11-26 08:56:39