CASTLE DEMO still the best 3rd person cam. sample?

Blitz3D Forums/Blitz3D Programming/CASTLE DEMO still the best 3rd person cam. sample?

Canali(Posted 2005) [#1]
Hi everyone.
Since I have problems implementing a satisfying 3rd person camera I was checking about the source codes implementing this kind of point of view.

Honestly I still found that, while beeing basic, the "Castle Demo" is still one of the better around.

Has anyone found a better way?

Obviously please hint me only samples with source code available :)
Thanks again.


jfk EO-11110(Posted 2005) [#2]
Did you check the Archives? I think there are several 3rd person cam examples.

Additionally I remember we discussed this issue a long time ago and we came up with some very nice ideas. One of them was a thombraider like camera, that would follo the player as usual, but when there is some obscurer between the camera and the player, the camera logic performs a seek for a better position like this:

Do a linepick towards the player. If the player is not visible, move the camera towards the player a little step. If the player is still obscured then repeat the previous steps until he can be seen again.

There must be some kind of limit for close up positions to prevent the camera to go inside the player mesh, in situations like when the players stands with his back against a wall. In this case, the camera may rotate around the player using sin/cos*radius until it finds a better position that allows a distance that makes more sense.

Rotating around the player in a matrix style or using a side- or frontview may also be performed randomly sometimes when the player is idle or something.

This method expects the building meshes to be pickable, except things like glass or gatters, fences etc. To prevent the camera from becoming confused from zoomin in and out repeatedly from eg. the bars of a fence, you simply would make the fence unpickable, so the camera would record from behind it.

Hope this helps.


Rogue Vector(Posted 2005) [#3]
I'm using the Castle Demo code for my third person perspective camera view.

The only problem I've had with it, is when the player model falls of a ledge, or down a well.

In these situations, the camera will stay in its current position while the character falls.

Only when the player hits the forward key will the camera go over the ledge and follow the character down.

Regards,

Rogue Vector


jfk EO-11110(Posted 2005) [#4]
from what I remember the CASTLE DEMO camera is using Collision, this may simplyfy things, but also creates some problems like a stuck camera.


KuRiX(Posted 2005) [#5]
To Prevent the camera stuck problem just check the distance between camera and player, and if it is >MaxDistance reposition the camera disabling temporaly the collisions.

I think that the camera must use collision always to prevent wall clipping.


Ross C(Posted 2005) [#6]
I use the same kind of method as KuRiX, by disabling collisions until the camera passes thru the current object.


jfk EO-11110(Posted 2005) [#7]
Yes, but what happens when the player walks using strafe keys and all of a sudden there's a wall between the player and the camera? That'a why I suggested to use a linepick to check if th eplayer is visible at all.And if he's not, move the camera towards him until it can see him again. This will also prevent a jumping camera when it has to correct collision problems.