collada

three.js - how do I get the vertices of an object?

Deadly 提交于 2019-12-13 04:43:59
问题 I am trying to import a model from blender and loop through all vertices. I am using the colladaloader for the import. It all works fine and the model is loading. But I do not want the faces of the model - I only need the vertex positions for my purposes. Can anyone tell me if there is a way to do this? e.g. a loop that loops through all vertices of the imported model? Thanks, Tomo 回答1: If geo represents your geometry: for (var i = 0; i < geo.vertices.length; i++) { var v = geo.vertices[i]; /

FreeCAD shape.read() Error: Unsupported format

泄露秘密 提交于 2019-12-13 02:54:10
问题 I am working on a project in which I have to convert a .dae file to .stl file. I am using the code given below import sys sys.path.insert(0, "C:\\Program Files (x86)\\FreeCAD 0.17\\bin\\") import FreeCAD import Part import Mesh shape = Part.Shape() shape.read('INPUTFILE.dae') doc = App.newDocument('Doc') pf = doc.addObject("Part::Feature","MyShape") pf.Shape = shape Mesh.export([pf], 'OUTPUTFILE.stl') I get an error when the interpreter tries to execute the command shape.read('INPUTFILE.dae')

Three.js ColladaLoader bumpScale/weighting? Way to adjust bump map intensity

给你一囗甜甜゛ 提交于 2019-12-12 05:53:16
问题 In the current ColladaLoader.js I don't see anything that reads or applies the Collada standard's "weighting" value (0.0-1.0) that indicates bump intensity or "bumpScale" in Three.js Phong material. I noticed that when I export my collada from Blender it picks up the bump materials instantly in three.js (which is amazingly simple - YAY!) but my materials always get an exaggerated bumpScale of default 1.0. It gives the materials an exaggerated bumpiness. I managed to edit my ColladaLoader a

camera and terrain collision on three.js

核能气质少年 提交于 2019-12-12 03:33:33
问题 I have a building model created with sketchup, exported as collada file and loaded to three.js with colladaloader. Everything works fine except that the camera can pass through walls. How do I prevent this? So far I have tried with Raycasting, but I think something is wrong. this is how the model is loaded loader.options.convertUpAxis = true; loader.load( 'model/cityhall.dae', function ( collada ) { dae = collada.scene; skin = collada.skins[ 0 ]; model_geometry = collada.scene.children[ 0 ]

three.js exporter 'export object' not working with jsonLoader (r58)

社会主义新天地 提交于 2019-12-11 19:21:08
问题 I'm trying to load a model I got from 3DWarehouse into three.js. I was unable to get the Collada Loader to work, so instead I imported it into THREEJS Editor and exported it using the "export object" function. When I loaded the object into my app using the following code: var kiss = new THREE.Object3D(), loader = new THREE.JSONLoader(true); loader.load("model/kiss/kiss.js", function (geometry, meshKiss) { meshKiss = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial()); kiss.addChild

How to start an a-frame animation by an “animationend” javascript function?

柔情痞子 提交于 2019-12-11 08:26:13
问题 I never worked with html, javascript or a-frame and I want to make three collada files visible and then invisible one after another (like a keyframe animation sequence)and loop that animation. That code works except for the possibility to loop the animation. <script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script> <script src="https://rawgit.com/donmccurdy/aframe-extras/master/dist/aframe- extras.loaders.min.js"></script> <script src="play-all-model-animations.js"></script>

Three.JS- Detecting intersection in Collada (Ray Casting)

大憨熊 提交于 2019-12-11 07:50:00
问题 There is a function in my prototype system which detects intersections when you click on a Collada file. The intersect function is below: function Intersectfun ( event ) { mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; var vector = new THREE.Vector3( mouse.x, mouse.y, 1 ); var toIntersect = []; THREE.SceneUtils.traverseHierarchy(scene, function (child) { if (child instanceof THREE.Mesh) { toIntersect.push(child); } }); //

Mesh Groups not visible Three.JS ColladaLoader

青春壹個敷衍的年華 提交于 2019-12-11 05:52:59
问题 Sketchup allows making components to facilitate re-use of geometry. For instance, a car wheel can be made into a component and 4 instances of the component can be used for the 4 wheels of the car. The question is how to put each re-used component into its own separate THREE.Object3d instance (which can then be rotated, positioned,... ie. controlled individually) i.e. how to retrieve each of the 4 wheels of the car as 4 separate THREE.Object3D instances. To do this, I exported a DAE from

SceneKit keyed blend shape animation imported from Collada (.dae) file (created in Maya) not playing

柔情痞子 提交于 2019-12-11 05:05:41
问题 I'm using Maya to create animations to use in SceneKit . I'm exporting as COLLADA file ( .dae ) using Maya's built-in FBX DAE exporter. Animations on the node transform all work perfectly. For example, if we have an animation of the translation, rotation, or scale -- or a combination of those -- the animation imports correctly with the node. However, when I import an animation based on keyed blend shape inputs, the animation doesn't play. Within Xcode, if I click on the .dae file and start

ColladaLoader and progressCallback

故事扮演 提交于 2019-12-11 01:19:43
问题 What is the correct way of implementing a loading bar in ColladaLoader ? The source code shows that the loader takes three parameters. One which is a progressCallback . progressCallback( { total: length, loaded: request.responseText.length } ); If I call a function for the progressCallback to display the values, The total shows up as null and the loaded goes up to 5,200,000. function(callback){ console.log(callback.loaded + ' / ' + callback.total); } How can I attach some sort of a percentage