If I've added this thread to the wrong forum category, my apologies, I'm new here and to WebGL
My problem is hopefully simple. I'm able to render several amounts of the same mesh, but when I try adding a different one: webGL only draws one object. Again, I could for loop and create 100 of the same mesh and put them in different positions, scales, and no problem. But if I try adding one more mesh, it draws the "first one" I called:
meshA = new Mesh(); <--- this one
meshB = new Mesh();
In fact, I could switch them over, and it would draw a different mesh, as long as it's the first one.
I'll post some psuedo code in order to visualize the anatomy of my application, but if it's too much, I'll try to make a list here.
Anatomy (no libs):
1) Engine Starts after Body.onload, and I create 2 meshes, I also create two Object3D objects. Which are pretty much like GameObjects in Unity.
Once images, sounds, etc are loaded, a callback is fired
2) Load3DObjects(): I set the viewport,clearColor,enable both cull_face and depth_test. Now I Load Shaders:
- fire ProgramLoaded callback function on the mesh
- Set Uniforms and Attributes: getUniformLocation, getAttribLocation