Comments (9)
@zardilior There is a geometry.parser
property in options object of Importer
class that handles loader input and converts to the right output.
You can find an example here: http://whs.io/module-components_meshes.Importer.html
I guess that's what he was asking about, @FeaturedSpace
from whs.js.
I wish I could answer this in a fuller extent, but basically, look into using the three.js tool. It is still working and should be specifiable through WhitestormJS
You should be able to integrate it into WHJS by specifying that loader (after importing it into your project) with this code:
geometry: {
path: '', // String. Url to model file.
physics: '', // String. Url of physics model. (opional)
loader: JSONLoader // Three.js loader. CHANGE THIS TO GLTFLoader
}
Obviously, make sure you change the code and import the GLTFLoader into your project!
And, if you have any further questions, I would suggest checking out this page: https://whsjs.readme.io/docs/model
Edit: Extended Formatting
from whs.js.
Problem with gltf in the parsing step
The three.js json format has already being deprecated
That format and the official blender exporter project have been removed.
Gltf is now the better approach according to three.js docs.
from whs.js.
I'm not sure I understand your meaning. The three.js JSON format shouldn't affect the importing of a GLTF...
Did you see where I said "CHANGE THIS TO GLTFLoader"
?
Sorry if I'm misunderstanding?
from whs.js.
Yeah I mean, what I mentioned was specifically was the GLTF parser that WHS is already supporting..
from whs.js.
@FeaturedSpace ok so I would import the GLTFLoader from the three.js website? Or is there one already made integrated within WHS, which isn't documented yet?
from whs.js.
Import both. Use the WHS one.
Like this:
geometry: {
path: '', // String. Url to model file.
physics: '', // String. Url of physics model. (opional)
loader: new Importer({
loader: new THREE.GLTFLoader(),
parser(geometry, material) { // data from loader
return new THREE.Mesh(geometry, material); // should return your .native (mesh in this case)
},
position: [0, 100, 0]
}).addTo(app);
}
from whs.js.
How to add to docs? I offer myself to do so, now that I have the code. I think its very important @FeaturedSpace
from whs.js.
That's a question for @sasha240100 !
from whs.js.
Related Issues (20)
- should we remove the object from this.children ? HOT 7
- MeshComponent parameter types should extend Component parameter types
- Examples Documentation points to wrong url for WHS.js, causing 404 HOT 1
- [ts] Property 'DefineModule' does not exist HOT 1
- WHS.ResizeModule does not play nicely with WHS.PostProcessorModule HOT 4
- Examples don't Work on Firefox HOT 2
- Dead? HOT 9
- Jpg Textures look solid color HOT 1
- v3.x.x HOT 9
- Network Module Extension HOT 5
- Setup @whs/w-examples
- Setup @whs/w-core
- Better docs on why we need Whitestorm over Three.js? HOT 2
- is this project die? strong to update three.js latest HOT 1
- Examples are broken HOT 5
- Is this still under active development? HOT 7
- Travis build broke HOT 1
- fix whs.io domain HOT 2
- WHS et VUEJS / ELECTRON HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whs.js.