3rd person camera indoor scene

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Zoulz
Posts: 12
Joined: Fri Aug 19, 2005 11:07 am
Location: Sweden
Contact:

3rd person camera indoor scene

Post by Zoulz »

Hi!
I have a indoor scene, with ceilings and walls etc. I want my 3rd person camera to collide with the world, so that the players character always is visible.

I've tried adding a collision response animator to the camera, but it doesn't work very well... the camera passes through walls etc anyway.

Any ideas?
Zoulz
Posts: 12
Joined: Fri Aug 19, 2005 11:07 am
Location: Sweden
Contact:

Post by Zoulz »

Nevermind, I managed to figure out a way to do it.

I draw a line from the cameras eye to target and then do a intersection test to see if there is a collision with the world. If there is, then I set the cameras eye position to that of the collision point. Works pretty well. :D
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

or...

Post by bitplane »

from the target to the camera's position would probably work better :)
Zoulz
Posts: 12
Joined: Fri Aug 19, 2005 11:07 am
Location: Sweden
Contact:

Post by Zoulz »

does it matter from which point i start and end? either way I get a line?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

if you had two walls between the target and the camera you'd stop on the first one, it makes more sense if you are stuck on the inside rather than the outside
Zoulz
Posts: 12
Joined: Fri Aug 19, 2005 11:07 am
Location: Sweden
Contact:

Post by Zoulz »

oh, yeah... your right about that! Of course, hehe... :roll:
Guest

Post by Guest »

Hi, i think i could glean some help from this topic. In my FPS style game i'm doing i want to basically attach the camera to a character model so that it follows them around in the 3rd person view at a set point behind them.

I've tried adding the camera as child to the character model but that produces some rather bizarre behaviour.... So i think that's not quite right!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I've found another thread which dealt with this which may well help me out, i'll be back if i have any troubles though!
Image Image Image
Post Reply