three.js - PointLight on js model and PlaneGeometry not the same -


i have planegeometry square , same square exported blender under point light, , plangegeometry behaves strange - when point light gets real close center of square square gets darker. not happening model square.

this geometry material setting:

var map = three.imageutils.loadtexture( "dirt.png"); map.wraps = map.wrapt = three.repeatwrapping; map.anisotropy = 16; var material = new three.meshlambertmaterial( { ambient: 0xbbbbbb, map: map, side: three.doubleside } ); var object = new three.mesh( new three.planegeometry( square_size, square_size, 1, 1 ), material ); 

this imported model js excerpt:

"materials" : [ {     "dbgcolor" : 15658734,     "dbgindex" : 0,     "dbgname" : "dirt",     "blending" : "normalblending",     "colorambient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],     "colordiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],     "colorspecular" : [0.5, 0.5, 0.5],     "depthtest" : true,     "depthwrite" : true,     "mapdiffuse" : "dirt.png",     "mapdiffusewrap" : ["repeat", "repeat"],     "shading" : "lambert",     "specularcoef" : 50,     "transparency" : 1.0,     "transparent" : false,     "vertexcolors" : false }], 

can make plane geometry work imported model?

the reason happening explained here: three.js: exact difference between lambert , phong?.

you have 2 choices:

  1. use meshphongmaterial instead, or
  2. increase tessellation of geometry so:

    new three.planegeometry( square_size, square_size, 10, 10 );

the first option better one.

three.js r.66


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -