Jump to content

Recommended Posts

Posted

So I am trying to parent the camera to my characters head for a first person view. Of course I go ahead and find the child head and create a mesh for it and all that.

 

When I go to parent the camera to the head, the camera get tilted into one side. When I comment out the parenting, then its just fine.

 

//Parenting and Not Working

EntityParent(frameWerk->GetMain().GetCamera(),head);

 

Not much more to it than that.

I even tried getting the camera rotation before parenting and then setting it back to that rotation but that didn't work.

 

//Recording, Parenting and Resetting

TVec3 rot = EntityRotation(frameWerk->GetMain().GetCamera());
EntityParent(frameWerk->GetMain().GetCamera(),head);
RotateEntity(frameWerk->GetMain().GetCamera(), rot);

 

 

 

What should I do to fix this?

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Posted

Use SetEntityMatrix/GetEntityMatrix instead of parenting. Parenting has lots of problems where positioning always works fine.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

Use SetEntityMatrix/GetEntityMatrix instead of parenting. Parenting has lots of problems where positioning always works fine.

 

No luck. Same effect. Even tried a manual get/set pos and get/set rotation. No luck.

 

Also, see the related thread here: http://leadwerks.com/werkspace/index.php?/topic/1927-find-child-entity-matrix-all-messed-up-bug/

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Posted

It sounds like your animation make the bone oriented in a way you did not intend. If you can post a demo showing your problem, someone can probably help you.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

It sounds like your animation make the bone oriented in a way you did not intend. If you can post a demo showing your problem, someone can probably help you.

 

This happens even before I start the animation. As for a demo, I'm going off of the Animation tutorial directly.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

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.

×
×
  • Create New...