xxv / jsc3d

Automatically exported from code.google.com/p/jsc3d
31 stars 20 forks source link

how to get the value to set JSC3D.Mesh's vertexBuffer indexBuffer texCoordBuffer and texCoordIndexBuffer in the demos "avatar.html" #108

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
  The demo of "avatar.html" is run successfully, and i find these codes in it:

var avatar = new JSC3D.Mesh;
avatar.name = 'lili';
avatar.vertexBuffer = [-0.0055,-0.6549,.....];
avatar.indexBuffer = [0,1,2,-1,2......];
avatar.texCoordBuffer = [0.625, 0.0039, 0.64...];
avatar.texCoordIndexBuffer = [0,1,2,-....];

My problem is ,which tool should i used to get the value like 
"-0.0055,-0.6549,....." or how can i get these values to filled in  
avatar.vertexBuffer, 
avatar.indexBuffer,avatar.texCoordBuffer,avatar.texCoordIndexBuffer

2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

jsc3d-full-1.6.5, operating system: win7 64bit

Please provide any additional information below.

Original issue reported on code.google.com by whn...@gmail.com on 27 Aug 2014 at 3:12

GoogleCodeExporter commented 9 years ago
Oh, I extracted those data from a VRML model via a piece of homemade python 
script. Generally, it's recommended to use existing model files such as obj, 
stl etc, rather than constructing the meshes by hand. 

Original comment by Humu2...@gmail.com on 28 Aug 2014 at 2:25

GoogleCodeExporter commented 9 years ago
thank you,i got it :)

Original comment by whn...@gmail.com on 28 Aug 2014 at 10:41

GoogleCodeExporter commented 9 years ago
another question:

If the obj,stl file is very big,there will be a long loading time,what if the 
same obj or stl file is insteaded by the mesheds that was construct by 
hand,will it be faster than loading an obj file?

Original comment by whn...@gmail.com on 28 Aug 2014 at 10:50

GoogleCodeExporter commented 9 years ago
Indeed, obj and stl are not compact data format. But I don't think moving data 
to be embeded in page could reduce the loading time significantly. To improve 
the user experience on very large models, I suggest you consider these 
solutions:

1. Convert the large models from obj or stl to OpenCTM format, which provides 
remarkable compression rate for mesh data. Knowledge on this format and the 
compression tool to generate it can be found here 
http://openctm.sourceforge.net/.

2. Modify the settings of your host server, assigning the transfer type for all 
obj files to be zipped. This way, the server will automatically compress an obj 
file before responsing to a request to it. Both the compression and 
decompression are completely transparent to the application level. Nothing 
needs to be changed then.

Original comment by Humu2...@gmail.com on 29 Aug 2014 at 2:20