خرید بک لینک

Vote count: 0

I have written (in THREE.js) a basic vertex editor ("sculpter") which allows the user to sculpt a single mesh object (currently with a planebuffer geometry). It uses vertex and fragment shaders to produce nice responsive preview and color effects.

I have now got the sculpter to export the modified buffergeometry to an OBJ file (using THREE.OBJExporter).

And the sculpter can load the same OBJ file back (using THREE.OBJLoader which parses an obj text structure and retus an Object3D. Each found object (in my case a single object) is converted to a Mesh with a BufferGeometry and a default MeshPhongMaterial. The phong material not important to me as I use a fragmentshader for coloring.)

I am now thinking of letting the user use the sculpter to apply vertex colors to the sculpted object. But then comes a problem of exporting/reloading those vertex colors with an OBJ file. This is because OBJ file standard does not handle vertex colors.

I see here that the free packages "MeshLab" and "MeshMixer" use a common extended OBJ-file definition which appends R,G,B values for each vertex directly after the vertex position X,Y,Z values.

I recall some time ago there was discussion on THREE.js Github about providing such an extension to THREE.OBJExporter and THREE.OBJLoader but it did not get done. Personally I would like to see vertex colors handled as a non-default option in the core THREE.OBJxxxxxx code.

Currently I am not conceed about these OBJ files being usable by other packages. So it seems to me that I could make modified versions of OBJExporter and OBJLoader to export and load vertex colors.


My Question

Is there (still using THREE.js) maybe a better/simpler/existing way of handling the export and reload of a single buffer geometry with vertex colors?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 31 تير 1395 ساعت: 4:12

صفحه بندی