Pawan Jadhav Posted June 23, 2016 Share Posted June 23, 2016 Currently we are using threeJS to render webgl content. Here is what i do : We have Jupiter Tesselation formated files, we convert these files to Json format. We are able to load these JSON files into threeJS. But i couldn't see any option in babylon where i can load these JSON files. See attached JSON files 1.json 2.json Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 23, 2016 Share Posted June 23, 2016 Hello the file seems pretty easy to load. There is no support per se of this format. Here is an example of how to create a mesh from similar data: http://www.babylonjs-playground.com/#1H7L5C#19 Quote Link to comment Share on other sites More sharing options...
Pawan Jadhav Posted June 24, 2016 Author Share Posted June 24, 2016 Thanks. I will give a try, will let you know. Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted June 27, 2016 Share Posted June 27, 2016 Hi, I wrote a partial 3 JS importer and thought that I could add on to use your file as well but ran into an issue. Does 1.json load into Three js ? Looking at the faces array the format looks wrong. "faces":[ 80, 0, 1, 2, 0, 0, 80 means index to face color, but you have only one color and yet there are several indices. "colors":[ 3355443 ], This is the code to decode it. if ( hasFaceVertexColor ) { for ( i = 0; i < 3; i ++ ) { colorIndex = faces[ offset ++ ]; face.vertexColors.push( new THREE.Color( colors[ colorIndex ] ) ); } } new THREE.Color( colors[ colorIndex ] would explode because there is only one color in the file. Quote Link to comment Share on other sites More sharing options...
Pawan Jadhav Posted June 28, 2016 Author Share Posted June 28, 2016 I could load this using threeJS Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted June 28, 2016 Share Posted June 28, 2016 I have to figure out how that works. When I looked at the raw code it doesn't make sense. I will be able to look more into this tomorrow. Have some other work that is pressing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.