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 / Different kind of camera question :-y

Author
Message
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 9th Aug 2006 18:31
hi

I have finally got the time to get really stuck into my game which i have finally decided on being a 3rd person (this was decided after a lot of umming and ahhring over fps &tps).

The type of camera i would like to use is like this.

The camera itself stays in one position eg in the top corner of a room and rotates and pitches to follow the player.

Every time the player goes a certain distance from the camera, the camera gets repositioned so the player can see themself better.

Remember it is a static camera that turns and pitches

The exact camera type I want to use is the one they use in Metal gear solid (for any who are familiar)

I can probably do the detection of how far away the player is and i can reposition the camera but i dont know how to let the camera know where to position itself so that it can see the player.

Will i have to make several cameras or can it all be done with one camera?

Cheers

BM

Our aim is to keep the loo's clean, your aim can help.
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 9th Aug 2006 18:56
you could position the camera yourself in each room & write down its xyz#s then position the camera there when your player goes in that room.
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 9th Aug 2006 19:01
There is that option but that would mean a hundred or so lines of



And there must be a way around that

Cheers anyway

BM

Our aim is to keep the loo's clean, your aim can help.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th Aug 2006 20:03 Edited at: 9th Aug 2006 20:05
You will already have fixed positions for the cameras. So, you need to establish which camera is closest, then if that camera can actually 'see' your player. If not use the second closest ... etc.

To establish which camera is nearest. Use a 3D distance function, there are plenty to be found ... just use the search button.

To establish if the camera can 'see' your player. Use the INTERSECT OBJECT command.

To have the camera look at your player use:
POINT CAMERA camera number , OBJECT POSITION X(player) , OBJECT POSITION Y(player) , OBJECT POSITION Z(player)


Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 9th Aug 2006 20:08
Thanks scraggle I will have a look for those functions and when using an intersect command will I have to attach a limb to the camera position?

Cheers

BM

Our aim is to keep the loo's clean, your aim can help.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th Aug 2006 20:17
No, no limbs needed. The syntax is:
Return Float=INTERSECT OBJECT(Object Number, X, Y, Z, ToX, ToY, ToZ)

The Return Float Will return the distance from your camera (X,Y,Z) to your Player (ToX,ToY,ToZ) or return Zero if it doesn't intersect. Effectively combining steps 1 + 2 of my previous post.


Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 9th Aug 2006 20:20
ok cool thanks again

I found two functions Im gonna try out to get the distance between player and character.

Cheers again

BM

Our aim is to keep the loo's clean, your aim can help.

Login to post a reply

Server time is: 2024-09-25 05:23:54
Your offset time is: 2024-09-25 05:23:54