Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, i just started experimenting with CopperLicht and ran into my first problem: when adding exactly one MeshBuffer i can see the polygons with texture. Cause i want to draw different polygons with different textures, i created a MeshBuffer for each texture and add all polygons which are using it. but when putting more than one MeshBuffer into a Mesh i get a blank render. Would be awesome if some1 could help me. Greetz |
||||
|
Sounds ok what you are doing, maybe you are missing something or causing an exception or similar. Is there an error message in the javascript console? Maybe you could post some of your code to see what you did. |
||||
|
i tried building some kind of map-grid. 16x16 squared consisting of 2 triangles (4 vertices) per square. im reading a text file which displays the map with chars. X = solid-wall-texture .=hole W=wall B=destroyable-wall etc... so the map file looks like this: XXXXX XBBBX XBBBX XBBBX XXXXX so i read the map file, and put all vertices information into an json/array: { 'X': {'indices': [], 'vertices': []}, 'H': {'indices': [], 'vertices': []}, 'W': {'indices': [], 'vertices': []}, 'B': {'indices': [], 'vertices': []}, '.': {'indices': [], 'vertices': []} } at last i return that json/array to my render code. each of the different blocks needs a different texture.. so i create a new MeshBuffer for X, one for H etc... because i can only assign one texture (?). bufs[map.blocks[b]] = new CL3D.MeshBuffer(); this.MyMesh.AddMeshBuffer(bufs[map.blocks[b]]); when my mapfile consists of only X or only H or only B etc. it works perfect. As soon as i have more than one buffer the scene is empty.. But the funny thing is that the mesh says that it has vertices Oo Here a screenshot showing left: 1 type, right: multiple types http://img26.imageshack.us/img26/748/drawbug.jpg |
||||
|
Sounds still ok to me. I just tried it out, and it works for me, so I guess you are doing something still differently. Maybe posting some more code might help? |
||||
|
EDIT: after hours and hours of debugging i found the problem, was in my script. somehow i forgot to recalculate the indices-number for every buffer.. damn.. Sry for that, was my fault |
||||
|
Ah, ok, nice :) |
|