AggrorJorn Posted October 16, 2010 Share Posted October 16, 2010 This is more of a discussion then a question. I have been working with Third person implementation for severall purposes. After trying a couple of things there are a couple of 'wonderings'. The easiest way of a TPC: position the camera at the characters position. parent the camera to the character move the camera backwards The approach discribed above works but has a major flaw which is not directly obvious. Everything works fine untill for example you come across a waterplane. Then you will notice the waters reflection is not correctly updated. This is because you parent the framework camera (main.camera) to the character and not the other 2 camera's (background and foreground). Okay, that sounds logical to me. One could say that besides the main camera parenting to the character, you could also parent the other 2 camera's to the character. Haven't been able to get that working so far. A second way of the TPC is: Place a pivot at the character Then inside the main loop you: Get the pivot's position and place the camera on that position. Get the pivot's rotation and add it to the camera rotation. Move the camera backwords for the offset. This solves the problem of the water reflection but this makes wonder why this works instead of the parenting. At the moment the main camera position and rotation are being updated but the other 2 camera's are not, right? Why is this working then and why not the parenting where we are also talking about 1 camera? Quote Link to comment Share on other sites More sharing options...
Canardia Posted October 16, 2010 Share Posted October 16, 2010 Parenting has many of those problems you describe (problems with rendering, problems with animations, problems with physics, etc...), so in most cases it's better to use SetEntityMatrix/GetEntityMatrix to simulate parenting. Usually I parent first, then see if it works, and it not, then I use SetEntityMatrix/GetEntityMatrix and continue with the game development. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ 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.