Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Importing a mesh

bagg
Registered User
Quote
2010-11-29 17:42:59

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


niko
Moderator
Quote
2010-11-30 16:36:20

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.


bagg
Registered User
Quote
2010-11-30 20:21:51

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?


niko
Moderator
Quote
2010-12-01 10:39:25

are you sure this is caused by the code you pasted? I guess this happens somewhere else.


bagg
Registered User
Quote
2010-12-01 11:13:12

I 'll Check again my arrays and come back


bagg
Registered User
Quote
2010-12-01 19:02:17

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.


sebmaster
Registered User
Quote
2011-01-15 01:59:23

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. :(


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact