Cytexx Posted May 17, 2018 Share Posted May 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted May 17, 2018 Share Posted May 17, 2018 First welcome! This should work exactly the same way everywhere. Can you reproduce the issue here: https://www.babylonjs-playground.com/ Quote Link to comment Share on other sites More sharing options...
Cytexx Posted May 22, 2018 Author Share Posted May 22, 2018 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); } } Quote Link to comment Share on other sites More sharing options...
Guest Posted May 22, 2018 Share Posted May 22, 2018 no error in the console? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 22, 2018 Share Posted May 22, 2018 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. Quote Link to comment Share on other sites More sharing options...
Cytexx Posted May 23, 2018 Author Share Posted May 23, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.