Sign in to follow this  
Cytexx

Differences from Chrome to other Browers

Recommended Posts

Hey Folks, 

I'm pretty new to Babylon JS so don't be too rude. 

In a project I'm currently working on, I stumbled over the problem, that my Code doesn't seem to run correctly in any other Browser than Chrome. 

The initial positioning is fine. But then I reposition vertices with: 

                      var positionsRightedge = rightSink.getVerticesData(BABYLON.VertexBuffer.PositionKind);
                      for(var q = 0; q < innerFace.length; q++){
                        positionsRightedge[innerFace[q]] = 0.5;
                      }
                      rightSink.setVerticesData(BABYLON.VertexBuffer.PositionKind, positionsRightedge);

And the outcome isn't the desired one. 

Is there maybe a difference in World-Space-Calculation across the browsers or anything like this? 

If more code or examples are needed I will provide them.

Hope someone recognizes the problem and can help :) 

Best regards,

Cytexx

Share this post


Link to post
Share on other sites

Hey, 
sorry for the late reply couldn't get access to my data because i was not in office. 
I can't reproduce the issue on the playground because I use custom models and it seems to be a general problem in my code or smthing like this. 
I can provide those screenshots: 

And an example from my code: 

             var bottom = newScene.getMeshByName('bottom'); 

             var rightSink = newScene.getMeshByName('rightSink');
             var leftSink = newScene.getMeshByName('leftSink');
             var originalPositions = bottom.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             var outerFace = [0, 3, 6, 9, 18, 21, 30, 33, 42, 45, 54, 57];
             var innerFace = [12, 15, 24, 27, 36, 39, 48, 51];


for(var i = 0; i < 24; i++){
                        var actualPosBottom = new BABYLON.Vector3(originalPositions[i*3]*value, originalPositions[i*3+1]*value, originalPositions[i*3+2]*value);
                        if( (i+3) % 3 == 0){
                          var positionsRightedge = rightSink.getVerticesData(BABYLON.VertexBuffer.PositionKind);
                          for(var q = 0; q < outerFace.length; q++){
                            positionsRightedge[outerFace[q]] = -actualPosBottom.x;
                          }
                          rightSink.setVerticesData(BABYLON.VertexBuffer.PositionKind, positionsRightedge);
                          var positionsLeftedge = leftSink.getVerticesData(BABYLON.VertexBuffer.PositionKind);
                          for(var q = 0; q < outerFace.length; q++){
                            positionsLeftedge[outerFace[q]] = actualPosBottom.x;
                          }
                          leftSink.setVerticesData(BABYLON.VertexBuffer.PositionKind, positionsLeftedge);
                        }
                      }

problem.jpg

Share this post


Link to post
Share on other sites

Maybe, because you did not say the vertices were update-able, in the original setVertices().  Are you using a .babylon, if so that is the case.  Then maybe chrome just kind of ignores this, but others are not so leniant?

It is just a theory.  If it is found to be the case, I know there is a topic about converting vertices from a .babylon to updateable.  Try searching.

Share this post


Link to post
Share on other sites

Ok, it was just my stupidity because the Mesh had not the right scaling and no deleted history within Maya. 
But after that I uploaded my whole thing on our server and it blew up again.
Somehow the overall world-matrix seems to be different. 
On my local network it runs correctly as described above, but after the upload on the server it looks like this: 
http://www.virtualkoeln.de/projects/max/babylonjs/index2.html

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.