javascript - THREE.js OBJLoader - load to Geometry, manipulate, then save to BufferGeometry -


I am trying to make the shade loaded loaded with ozlogslider not gemetry.

  Var loader = new three Ob J Loader (manager); Loader.load ('/ manmodel / js / man.obj', function (object, content) {console.log}; console.log (content); man = object; man.traverse (child) {if (Child.geometry.computeFaceNormals (); child.geometry.computeVertexNormals (true); child.material = New THREE.MeshPhongMaterial ({color: 'white', Cinematography: Three. Microscoding // & lt; ------ ----- this is the problem}};}}); man.position.y = -10; view.ed (man);});  

The result is:

apparently flat cinematography

If I line computeFaceNormals () Removes the model, the model renders it to itself If I provide computeVertexNormals (true) with a light (black) - then I know that it is doing something.

If I change the color attribute of MeshPhongMaterial in this code, So the color changes, so I also know that it is working.

I have tried to use the top and general assistants to establish the problem, but they have failed Because of the buffer gimetry, the face and the vertical And are not stored as arrays.

I also tried to modify the man.obj file to change the value of 1 with 'off'. it was nothing.

As I am loading many files for various human shapes generated in .obj Blender, and each currently is around 2 MB, I like to do shading in the browser because the file is 'baking it' ', If this file size will increase.

Question: Am I missing something here? Or, there is a way to load .obj files in the form of standard gemetry, calculate normal, apply shading and then save as buffer gimetry?

ps I may also need general rules for tracing down the line.

The latest version of the ObjLoader purse for buffer gemetry for performance reasons .obj If you have history on GitHub If you look back on the back, you can find the previous version that parse the geometry:

Load your .obj using this and by then you will be able to load You can manipulate this if you need it, then create a new buffer geometry and get the display Buffer Zimetry. Load geometry into it using fram gemetry (geometry). I have to work it well.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -