【问题标题】:threejs find position of plane from JSONLoaderthreejs 从 JSONLoader 中找到平面的位置
【发布时间】:2012-11-18 04:25:40
【问题描述】:

我有这个由搅拌机生成的 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" : {}

}

【问题讨论】:

    标签: three.js


    【解决方案1】:

    这个 jsonfile 不包含位置数据,因为它只有几何和材质。

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

    【讨论】:

      猜你喜欢
      • 2023-04-02
      • 1970-01-01
      • 2017-01-19
      • 2013-07-31
      • 2015-11-17
      • 1970-01-01
      • 2015-03-23
      • 2018-08-10
      • 2017-10-04
      相关资源
      最近更新 更多