Giter Site home page Giter Site logo

Comments (6)

NikLever avatar NikLever commented on August 27, 2024

from learn-webxr.

Simon1059770342 avatar Simon1059770342 commented on August 27, 2024

THX Nik! This helps a lot!
One last qusetion for your last words,
"The last step is to restore the players original quaternion. Then in the render loop we use the slerp method of the quaternion class to interpolate towards this pre-calculated quaternion.",
What's the purpose for " to interpolate towards this pre-calculated quaternion."?

from learn-webxr.

NikLever avatar NikLever commented on August 27, 2024

from learn-webxr.

Simon1059770342 avatar Simon1059770342 commented on August 27, 2024

THX Nik! This clear my doubt on interpolation.

Still some doubts stay.

  1. Do you mean lookAt is served for "If a character is climbing or descending we still want them to remain upright. "

If it is, I wrongly reckoned lookAt as a function for changing direction of knight from current to face target spot, which rotate around the y-axis.

And I test the code followed is work on keeping knight upright:

    const pt = this.object.position.clone();
    pt.z += 10;
    this.object.lookAt(pt);
  1. What is the purpose for "The last step is to restore the players original quaternion. " instead of just keeping the changed quaternion in players as same as this.quaternion
    this.quaternion = player.quaternion.clone();
    player.quaternion.copy(quaternion);

from learn-webxr.

NikLever avatar NikLever commented on August 27, 2024

from learn-webxr.

Simon1059770342 avatar Simon1059770342 commented on August 27, 2024

THX Nik!That's quiet clear Now!

Sorry for the endless question, Hope you dont mind!

from learn-webxr.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.