Jump to content

Handling third person camera


cassius
 Share

Recommended Posts

I am using aggrors third person example as the basis for my game and it is going well. In the tutorial he avoids the camera being hidden behind walls by switching to first person position when a wall is detected. Works ok for the most part but it made me wonder if there were other ways of doing this. Has anyone tried some other method?

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Working in theory here, you could have it move up when it detect's a wall, then have it move in the opposite direction to the wall, finally snapping into first person. I'm not sure how to do this in code, but I would assume when it detects a wall it gives you a direction to the object.

Operation Mosquito

Recruiting 3d Modeller/Animator. (pm if interested)

 

It is the greatest of all mistakes to do nothing because you can do only a little. Do what you can. - Sydney Smith
Link to comment
Share on other sites

The same thing could be achieved by letting the user roll the mousewheel forward and back. This would give the user control .In my le2 game I made no provision for this problem. I just had my character fairly close to the camera and made walls thick and ceilings high so the problem rarely occurred.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Personally I would move the camera towards the target (player) until no collision is detected (if it ends up to be too close to the character then would switch to 1st person as well) and also at defined close position I would switch the material of the character to use an alpha transparent shader so you won't have the view blocked by your own character. It's not something I did in LE till now (but may be I will give it a try) but this is something I'm used to do elsewhere.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

If you attach the camera to a physics object, like a small sphere, and then apply a spring force (proportional to distance) towards the target position, the physics engine can handle this for you. More complex collision shapes can also keep the camera a minimum distance from terrain, or ensure an unobstructed line of sight to (or beyond) the character.

Link to comment
Share on other sites

I found that aggrors method worked fine exept when character walked up slopes and it switched from first to third person somewhat eccentrically but this turned out to be because I was running in debug mode. In release mode it ran smoothly.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...