darkcoordinate / blender-webgl-exporter

Automatically exported from code.google.com/p/blender-webgl-exporter
0 stars 0 forks source link

Cannot reproduce WebGL example data #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

The example data in blender-cube.js includes five lines of data as follows
(truncated):
var BlenderExport = {};
BlenderExport.Cube = {};
BlenderExport.Cube.vertices = [1.000,1.000,...
BlenderExport.Cube.indices = [0,1,2,3,4,5,6,...
BlenderExport.Cube.texCoords = [0.333,0.498,...

When I export data selecting Native WebGL, the output file looks like this:

var BlenderExport = {};
BlenderExport.Cube = {};
BlenderExport.Cube.vertices = [1.00,1.00,-1.00,1.00, ...
BlenderExport.Cube.indices = [];
for(var i=0;i<15;i++) BlenderExport.Cube.indices.push(i);
BlenderExport.Cube.normals = [0.58, 0.58, -0.58,0.58, ...

Am I doing something wrong?

If not, then it seems that I will need to:

1. rename BlenderExport.Cube.normals.

2. Calculate the number of vertices, indices and texcoords and adjust
numitems in index.html.

Original issue reported on code.google.com by t.arm...@gmail.com on 9 May 2010 at 8:54

GoogleCodeExporter commented 8 years ago
It looks like the example is from an older version of the exporter; having 
checked
the code, the change from explicit listing of indices to using a for loop same 
in in
r13, and the samples weren't updated.

It looks like it would be useful to include the .blend file with this sample, 
anyway
-- it uses texture coordinates that look like they've been carefully calculated 
to
work with the texture image, so it would be good to have them there so that 
people
can re-create the sample .js file.

Original comment by giles.th...@gmail.com on 13 May 2010 at 5:21