jeromeetienne / AR.js

Efficient Augmented Reality for the Web - 60fps on mobile!
MIT License
15.78k stars 2.22k forks source link

How to play animation built into GLTF model #304

Closed digitalmaniak closed 6 years ago

digitalmaniak commented 6 years ago

I've downloaded this gltf model with built in animation: https://sketchfab.com/models/8d06874aac5246c59edb4adbe3606e0e#

link to this project: https://3ckid.com/01/AR_Mech_Drone.html

I got the model showing up and working properly but i cannot seem to figure out how to call and play the animation.

Using these two libraries https://aframe.io/releases/0.7.1/aframe.min.js https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js

This is how I'm loading the gltf model and calling the animation

<a-gltf-model src="https://3ckid.com/01/assets/mech_drone/scene.gltf" position="0 2 0.25" rotation="90 180 0" scale="0.01 0.01 0.01" animation-mixer="clip: Take 001; loop:once"> </a-gltf-model>

Can anyone help me figure out how to make this guy animate. Any help would be much appreciated.

Thanks in Advanced, Angel :)

digitalmaniak commented 6 years ago

I actually figured it out. It must've been playing the animation before I used the marker. I realized you do not have to specify a clip name, and I changed loop to repeat. Additionally I had to include aframe-extras-loaders.min.js

hexaconnect commented 6 years ago

what is your marker?

digitalmaniak commented 6 years ago

im using the Hiro marker

Saad29 commented 6 years ago

Hi @digitalmaniak , can you please share your code? I am having a tough time loading models

digitalmaniak commented 6 years ago

Hey @Saad29 Here is preview link to the Demo (works using hiro marker): https://3ckid.com/01/AR_Mech_Drone.html

Download link to that demo: https://3ckid.com/01/MechDrone_Demo.zip

Also important to have a secure host "https" for this to run smoothly.

Saad29 commented 6 years ago

thanks a lot @digitalmaniak

vettorazi commented 6 years ago

nice work! question about the loop: if you choose to not repeat, it will even play without the marker? or it just play when the marker are recognized?

digitalmaniak commented 6 years ago

@vettorazi Yes it WILL play even before it identifies the marker.

I know that there was another thread that explains how to set up some sort of listener for the marker and then you can play animations or other things you may want to do once the marker is recognized.

Try this: https://github.com/jeromeetienne/AR.js/issues/111

vettorazi commented 6 years ago

Oh thanks! This is helpfull!

Em qui, 12 de abr de 2018 17:14, Angel notifications@github.com escreveu:

@vettorazi https://github.com/vettorazi Yes it WILL play even before it identifies the marker.

I know that there was another thread that explains how to set up some sort of listener for the marker and then you can play animations or other things you may want to do once the marker is recognized.

Try this:

111 https://github.com/jeromeetienne/AR.js/issues/111

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeromeetienne/AR.js/issues/304#issuecomment-380930452, or mute the thread https://github.com/notifications/unsubscribe-auth/AHR-j66qsLVbtoPY6UQcQn-kCaenZbPFks5tn7WfgaJpZM4R3Ysw .

crmun commented 6 years ago

Add this if you missed.

nicolocarpignoli commented 6 years ago

closed as resolved

willxvi commented 5 years ago

Can you send the example again ? Link is broken.

nicolocarpignoli commented 5 years ago

What link in particular?

willxvi commented 5 years ago

These links: https://3ckid.com/01/AR_Mech_Drone.html

https://3ckid.com/01/MechDrone_Demo.zip

nicolocarpignoli commented 5 years ago

maybe something useful here before @digitalmaniak answers? https://github.com/digitalmaniak/webAR

digitalmaniak commented 5 years ago

These links: https://3ckid.com/01/AR_Mech_Drone.html

https://3ckid.com/01/MechDrone_Demo.zip

Sorry for late response I had a hard time searching for these but heres what I found: http://lgadftp.com/Preview/AR/AR_Mech_Drone.html http://lgadftp.com/Preview/AR/AR_Mech_Drone1.5.html

Here is everything I worked on. Html files + model files: http://lgadftp.com/Preview/AR/all_demos.zip (310MB)

droid001 commented 5 years ago

@digitalmaniak I'm gettting WebRTC errors on these links as they aren't served with https. Any chance you could setup SSL for your site?

kalwalt commented 5 years ago

@droid001 @digitalmaniak i can confirm this, I'm gettting WebRTC errors too.

CamiloB commented 4 years ago

the errors is chrome they put something you need a https request to acces any hardware im mounting this on my server if this works ill put the response here thanks