define(["pex/core/Vbo", "pex/core/Vec3", "pex/core/Vec4"], function(Vbo, Vec3, Vec4) {
  
  //options = {
  //  primitiveType : eg.: gl.POINTS  
  //}
  function Mesh(gl, geometry, material, options) {
    this.options = options || {};
    this.gl = gl;
    this.material = material;
    this.geometry = geometry;    
    this.vbo = Vbo.fromGeometry(gl, geometry, this.options.primitiveType); 
    this.position = new Vec3(0,0,0);
    this.rotation = new Vec4(0, 1, 0, 0);
    this.scale = new Vec3(1, 1, 1);
  }
  
  Mesh.prototype.draw = function(camera) {
    
    if (camera) {          
      this.material.uniforms.projectionMatrix = camera.getProjectionMatrix();
      this.material.uniforms.viewMatrix = camera.getViewMatrix();    
      this.material.uniforms.modelViewMatrix = camera.calcModelViewMatrix(this.position, this.rotation, this.scale);
  	  this.material.uniforms.normalMatrix = this.material.uniforms.modelViewMatrix.dup().invert().transpose();
    }
    
    this.material.use();
    
    this.vbo.draw(this.material.program);
  }
  
  return Mesh;
});
@@ -87,16 +87,130 @@
 %0A  %0A  //
+  Parameters:%0A  //    gl - gl context%0A  //    meshData - vbo or geometry%0A  //    material - mesh material%0A  //    
 options 
@@ -217,16 +217,20 @@
 = %7B%0A  //
+    
   primit
@@ -260,16 +260,18 @@
 S  %0A  //
+  
 %7D%0A  func
@@ -284,24 +284,24 @@
 esh(gl, 
-geometry
+meshData
 , materi
@@ -401,42 +401,130 @@
 al;%0A
-    this.geometry = geometry;    %0A
+%0A    if (meshData instanceof Vbo) %7B%0A      this.vbo = meshData;%0A    %7D%0A    else %7B%0A      this.geometry = meshData;        %0A  
     
@@ -555,24 +555,24 @@
 try(gl, 
-geometry
+meshData
 , this.o
@@ -594,16 +594,30 @@
 eType); 
+  %0A    %7D     %0A
 %0A    thi

Support for VBO in Mesh constructor