threejs从JSONLoader找到飞机的位置

时间:2012-11-15 17:04:06

标签: three.js

我有这个由blender生成的JS,我通过JSONLoader加载它。它只是一个带有纹理的平面。我只是想找到它的位置,在它的法线向量中添加一个亮点(在它前面)3点之外用于添加点光的属性是什么?我怎么知道那个光的位置?

我是关于threejs的新手,我在javascript检查器中找了一些属性来找到这个,但是我看不到它......

谢谢!!!

{

"metadata" :
{
    "formatVersion" : 3.1,
    "generatedBy"   : "Blender 2.63 Exporter",
    "vertices"      : 4,
    "faces"         : 2,
    "normals"       : 1,
    "colors"        : 0,
    "uvs"           : [4],
    "materials"     : 1,
    "morphTargets"  : 0,
    "bones"         : 0
},

"scale" : 1.000000,

"materials" : [ {
    "DbgColor" : 15658734,
    "DbgIndex" : 0,
    "DbgName" : "texturaLadrillos",
    "blending" : "NormalBlending",
    "colorAmbient" : [0.6900000198185445, 0.6900000198185445, 0.6900000198185445],
    "colorDiffuse" : [0.6900000198185445, 0.6900000198185445, 0.6900000198185445],
    "colorSpecular" : [0.5, 0.5, 0.5],
    "depthTest" : true,
    "depthWrite" : true,
    "mapDiffuse" : "JP_Brick01_Bump.jpg",
    "mapDiffuseWrap" : ["repeat", "repeat"],
    "shading" : "Lambert",
    "specularCoef" : 50,
    "transparency" : 1.0,
    "transparent" : false,
    "vertexColors" : false
}],

"vertices" : [-53.8264,3.757e-06,85.9501,-8.9211,3.757e-06,85.9501,-53.8264,46.0109,85.9501,-8.9211,46.0109,85.9501],

"morphTargets" : [],

"normals" : [0,0,1],

"colors" : [],

"uvs" : [[0,0,1,0,1,1,0,1]],

"faces" : [42,0,1,3,0,0,1,2,0,0,0,42,2,0,3,0,3,0,2,0,0,0],

"bones" : [],

"skinIndices" : [],

"skinWeights" : [],

"animation" : {}

}

1 个答案:

答案 0 :(得分:0)

此json文件不包含位置数据,因为它只包含几何和材质。

您应该使用网格来定义位置。