snout-o / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

Viewer not updating properly #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I want change the vertexBuffer of a mesh on a button click,here is my code ,its 
not working in chrome but working in firefox;

function changesize(size)
    {
         $.ajax({
             type: 'POST',
             url:  'newpiont.php',
             data: "part_id="+size,
             success: function(result){
                scene.removeChild(lowernormal);
                var Allpoint = JSON.parse(result);

                lowernormal.vertexBuffer = JSON.parse("[" + Allpoint['vertexBuffer'] + "]");
                lowernormal.indexBuffer = JSON.parse("[" + Allpoint['indexBuffer'] + "]");
                lowernormal.texCoordBuffer = JSON.parse("[" + Allpoint['texCoordBuffer'] + "]");
                lowernormal.texCoordIndexBuffer = JSON.parse("[" + Allpoint['texCoordIndexBuffer'] + "]");
                lowernormal.setMaterial(mat);
                lowernormal.init(); 
                scene.addChild(lowernormal);
                viewer.update();
                          }
            });

Original issue reported on code.google.com by prasen.b...@gmail.com on 31 Jul 2014 at 10:51