Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi Niko. Glad to help with bugs.Now i have a problem on importing a mesh in copperlicht.As i understand if we want to describe let's say a box mesh in copperlicht we must give 24 indices and 24 vertices.I am trying to describe a box exported from 3d Studio max.All the exporters that i've tried are describing a box mesh with 8 vertices and 12 indexes.If i use this method in copperlicht i can only see the inside of the faces.Can you please suggest me an exporter for 3d studio max that's exporting the meshes the way they must be described in copperlicht? Thanks |
||||
|
Hm, you can of course also use 8 vertices and 12 indices. If you do that, and only see the inside, you need to flip the faces. You can do this easily by simply reordering the indices, simply flip every 2nd and 3rd index, like that: Suppose you have the indices 0,1,2, 0,2,3, 0,3,4 etc, then reoder them to become 0,2,1, 0,3,2, 0,4,3 This should help. |
||||
|
Ok thanks. Now i have the vertexes of a box in an array and i want to use a loop in order to fill the meshbuffer i use this loop but it doesn't work for (var j = 0; j < XYZArray.length; j+=3) { Meshbuff.Vertices.push(createVertex(XYZArray[j],XYZArray[j+1],XYZArray[j+2],0,0)); } error: this.Box.reset is not a function code: copperlicht.js line: 9 Can you point me on how to do this? |
||||
|
are you sure this is caused by the code you pasted? I guess this happens somewhere else. |
||||
|
I 'll Check again my arrays and come back |
||||
|
OK it's probably something wrong with my array but i want to report to you that the examples are not working in firefox 4 beta 7 check it out. |
||||
|
This should help. Thanks niko, that tip was very essential for me right now. Maybe you should note that somewhere in the documentat, on. I had a hard time finding it. :( |
|