cassius Posted June 14, 2013 Share Posted June 14, 2013 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? Quote 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 More sharing options...
MikeClarke Posted June 14, 2013 Share Posted June 14, 2013 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. Quote 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 More sharing options...
cassius Posted June 14, 2013 Author Share Posted June 14, 2013 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. Quote 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 More sharing options...
ZioRed Posted June 14, 2013 Share Posted June 14, 2013 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. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Tim Shea Posted June 21, 2013 Share Posted June 21, 2013 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. Quote Link to comment Share on other sites More sharing options...
cassius Posted June 21, 2013 Author Share Posted June 21, 2013 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. Quote 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 More sharing options...
AggrorJorn Posted June 21, 2013 Share Posted June 21, 2013 The example in the tutorials doesn't have any smoothing. You could use a linear interpolation to fix this. Tim She'd way. Also a good.approach. It will prevent wall clipping. Something that will.happen when you use the tutorial. Quote Link to comment Share on other sites More sharing options...
cassius Posted June 21, 2013 Author Share Posted June 21, 2013 Like to know more about linear smoothing if anyone can help Quote 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 More sharing options...
Recommended Posts
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.