Camera Update

October 26, 2018

Right, so the rotations are fixed. The issue lie in how the offset rotation was added to the base input.

 

In short, this is how it works: MainCamera is the one that renders the image. BCamera is the desired position and rotation.

 

We use a lerp to make MainCamera's position the same as BCamera over a second or so, and make it move to that position in a panning motion.

 

We can do the same for the rotation, but that caused problems.

 

Below you ca see the code for the old rotation calculation, which multiplies two quaternions ( the Storage.SumQuaternions() function)). This is because, depending o n the character, MainCamera may have to be upside-down (You have to turn the phone), and so it gets an offset on top of the new position and rotation. That however messes up the movement, and it gets shifted 90 degrees on the  Y and Z axis for some reason.

 

 

To fix and make the system way more stable I instead placed the offset before the Lerp even happens, so that it's like the BCamera transform was upside down to begin with. That's the endRot variable that you can see.

 

 

Now on to fix annoying transparency with the outline shader. Cheers.

 

Share on Facebook
Share on Twitter
Please reload

Uitgelichte berichten

I'm busy working on my blog posts. Watch this space!

Please reload

Recente berichten

October 26, 2018

October 25, 2018

October 23, 2018

May 30, 2018

Please reload

Archief
Please reload

Zoeken op tags

I'm busy working on my blog posts. Watch this space!

Please reload

Volg ons
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square