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 Discussion / 1ST/3RD Person Views

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd Mar 2004 14:42 Edited at: 3rd Mar 2004 16:03
Hello I need help on this how do I set up a 1st and 3rd person view so I can see out of a FPS charector's eyes and then switch to the second camera looking at the back of the object/person's eyes and assign switching views to the keyboard?

Sorry scroypo , that hilled thing I couldn't really get it to work with my flight H.O.T.A.S thing as I want the joystick hat to be able to control the 1st person view, I will keep trying it though
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Mar 2004 16:08
Well, you could do it a couple of different ways...

The main one would be to calculate the y position of the characters eyes ( ie, the head ) then position camera at the character's x and z positions along with the y position you calculated... But, you have to hide the object so that you can see out of it

Then, for the 3rd person view, simply use something like;



Then, to switch between the views, just do a check for a differnt key, ie, If InKey$() = "3" Then do 3rd person, If InKey$() = "1" Then do 1st person...

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd Mar 2004 16:17
So would I need to use move camera1 and move camera 2, I kind of got Hilled after a while but I think that was done in DBP as I can't see the cube in it.

I see you also have to hide the object to see out of it as well.
Do I just put the 3dr person camera position then and that's it? Jess
Thanks for the help by the way
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd Mar 2004 20:09 Edited at: 3rd Mar 2004 20:18
Actually I went back to that code Hilled Scorpyo gave me and I mangaed to get the basics of a hovertank with it.I managed to make it straffe and turn although I would need to add a joystick P.O.V. view and I am having difficulty in loading objects to use with the code.

Still having problems doing it for a flight sim though, I get the controls easy enogh but I still can 't get the camera's to workbut I have started to look closely at that code though, but if I get the camera's then my game would nearly be finished within three months
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Mar 2004 10:56
You cannot have multiple camera's in DBC... You have to use the one camera, and move it about so that it seems like there is more than one camera.

For the First Person camera, when the user presses or clicks whatever to say " Go to First person View ", then you would not change anything except the camera, which you would positoin at the same position as the object, and you would also hide that object...

Then, for the Third person camera, when it is selected, you would use that code I posted earlier...

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 4th Mar 2004 11:14
Yes I see you move the camera around, well I really need help with that because I think that code Scorpyo wrote was in DBP and I also wan the camera to be controlled by the joystcik hat so if your in a cockpit plane you can look around.

Can you show me how this is done? I get the 1st person stuff very well but I can't seem to change the camera from 1st to third using the keys I just ned to know how you would write that.

Thanks Jess
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Mar 2004 11:41
Ah, ok...

Well, have a flag variable to check which camera mode you're currently in...



Then, you check that value before you position the camera...



That will make it so that when the cammera mode is set to different values, the positioning will be done accordingly...

Next, you need to know if the user wants a different camera mode...



And that should be the basics of what you need...

If you need any more help, just ask

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 4th Mar 2004 21:36
Thanks Jess I will,

Login to post a reply

Server time is: 2025-05-23 08:17:49
Your offset time is: 2025-05-23 08:17:49