Giter Club home page Giter Club logo

Comments (1)

 avatar commented on May 21, 2024

I also am struggling with this but probably because I stink at coding in JavaScript.

In the code base I use - there is a class just before a function that I'm not sure about. But within what appears to be an initialization function using a GLTF loader doing something with a '=>' thing that enables us to set parameters about the gltf model.

` loadGLTF('https://cdn.glitch.com/f485dc5e-a1b5-4091-8408-6411aea91377%2Ftext_1%20(1).glb?1555527607936').then(gltf => {
gltf.scene.scale.set(.03, .03, .03)
gltf.scene.rotation.set(90, 0, 180)
gltf.scene.position.set(4, 0, -9)
gltf.scene.quaternion.setFromAxisAngle(new THREE.Vector3(0, 0, 0), Math.PI)

					gltf.scene.traverse(node => {
						if (node.material && (node.material.isMeshStandardMaterial || (node.material.isShaderMaterial && node.material.envMap !== undefined))){
							node.material.envMap = this.envMap
							node.material.needsUpdate = true
						}
					})

					this.floorGroup.add(gltf.scene)
        this.floorGroup.add( axesHelper );
				}).catch((...params) =>{
					console.error('could not load gltf', ...params)
				})
      
      `

I took three approaches here:

  1. Just copy paste the system from https://threejs.org/docs/index.html#manual/en/introduction/Animation-system
  2. refactor the bottom portion to play nice
    // Play all animations
    clips.forEach( function ( clip ) {
    mixer.clipAction( clip ).play();
    } );

so...
gltf.scene.animationClip.mixer.clipAction.set( play();

  1. Just use A-frame and hope to the heavens it is that simple.....

None of this worked, obviously. So...if anyone has any spare time to give me a clue it would be much appreciated.

from webxr-polyfill.

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.