Giter Site home page Giter Site logo

Comments (5)

bialpio avatar bialpio commented on May 29, 2024 2

THX for your help! Do you mean I can get the anchor for my placed model, and change the pose of the anchor whatever I want?

No, anchor pose is going to be updated by the underlying XR system. When you create an anchor, we are giving you a promise that we will try to update its pose so that it remains fixed relative to the real world. You can then introduce another pose that describes object's coordinates relative to the anchor - you fully control this pose so you can set it to whatever you like.

Maybe a useful way to think about this is: AR APIs are there to try and tell you where the underlying XR system thinks things are in the real world, and you can use that information to influence where you render your own models relative to those "landmarks" the XR system knows about.

If so, an other issue suddenly came out of my mind: Does WebXR have an Animation API for model movement, or I could make that animation by common ways in JS (like using setTimeout to change model pose every other second)

No, WebXR does not have an animation API. When you write a WebXR-powered application, you set a callback via XRSession.requestAnimationFrame(). This callback will be called with time as a parameter, which you can use to drive your animations.

Let me know if this helps! There's an example on how to use Anchors API here, with source code here. Chrome also has additional example here, with source available here (it is used for debugging & a bit more complex as it uses hit-test for anchor placement and also can optionally use an experimental plane detection API, so it may be harder to follow what is happening).

from anchors.

AdaRoseCannon avatar AdaRoseCannon commented on May 29, 2024 1

from anchors.

Simon1059770342 avatar Simon1059770342 commented on May 29, 2024

THX for your help!
Do you mean I can get the anchor for my placed model, and change the pose of the anchor whatever I want?
If so, an other issue suddenly came out of my mind:
Does WebXR have an Animation API for model movement, or
I could make that animation by common ways in JS (like using setTimeout to change model pose every other second)

from anchors.

Simon1059770342 avatar Simon1059770342 commented on May 29, 2024

THX a lot! This helps me a lot!
Follow your advice, I expected to try the plane detection of the environment sample, but I fail with error in my console showed in Fig.1.
image

So is there any possible way of visualize result of world detection? Example as Fig.2
image

from anchors.

Simon1059770342 avatar Simon1059770342 commented on May 29, 2024

Today I found a demo that can almost explain what I need.
If you are interested please try demo in WebXR Viewer on IOS device

from anchors.

Related Issues (20)

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.