提交 d7ec2be7 编写于 作者: A alteredq

Added embedded ascii JSON meshes to SceneLoader.

上级 b9977ede
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
......@@ -86,6 +86,15 @@ var scene = {
"scale" : [ 1, 1, 1 ],
"visible" : true
},
"colorcube" : {
"geometry" : "colorcube",
"materials": [ ],
"position" : [ -10, -5, 30 ],
"rotation" : [ 1.57, 0, 0 ],
"scale" : [ 5, 5, 5 ],
"visible" : true
},
"veyron" : {
"geometry" : "veyron",
......@@ -203,11 +212,53 @@ var scene = {
"veyron": {
"type": "bin_mesh",
"url" : "obj/veyron/VeyronNoUv_bin.js"
}
},
"colorcube": {
"type": "embedded_mesh",
"id" : "cube_fvc"
}
},
"embeds": {
"cube_fvc": {
"version" : 2,
"scale" : 1.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "Material",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.5, 0.5, 0.5],
"specularCoef" : 50,
"transparency" : 1.0,
"vertexColors" : true
}],
"vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
"morphTargets": [],
"normals": [],
"colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
"uvs": [[]],
"faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21],
"edges" : []
}
},
"materials":
{
/*
......
......@@ -244,6 +244,16 @@ THREE.SceneLoader.prototype = {
};
function create_callback_embed( id ) {
return function( geo ) {
result.geometries[ id ] = geo;
}
};
function async_callback_gate() {
var progress = {
......@@ -449,6 +459,17 @@ THREE.SceneLoader.prototype = {
callback: create_callback( dg )
} );
} else if ( g.type == "embedded_mesh" ) {
var modelJson = data.embeds[ g.id ],
texture_path = "";
if ( modelJson ) {
jsonLoader.createModel( modelJson, create_callback_embed( dg ), texture_path );
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册