ozRocker Posted July 25, 2017 Share Posted July 25, 2017 Is it possible to move a group of vertices surrounding a clicked area on a mesh? I'm thinking of sculpting tools like "inflate" and "shrink". So if there's a mesh like Decal Cat would it be possible to inflate an area that is clicked on? https://www.babylonjs-playground.com/#1BAPRM Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 25, 2017 Share Posted July 25, 2017 That's what I'm doing here: https://www.babylonjs.com/scenes/worldmonger/ But not that obvious as you need to also recompute normals accordingly Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 25, 2017 Author Share Posted July 25, 2017 6 hours ago, Deltakosh said: That's what I'm doing here: https://www.babylonjs.com/scenes/worldmonger/ But not that obvious as you need to also recompute normals accordingly This looks cool! But I think it doesn't load properly 'cos of the errors. I'm getting a lot of Mixed Content: The page at 'https://www.babylonjs.com/scenes/worldmonger/' was loaded over HTTPS, but requested an insecure script 'http://code.jquery.com/jquery-1.9.1.js'. This request has been blocked; the content must be served over HTTPS. kind of errors, so its failing to load jquery. Hmm...I must have a sensitive version of Chrome, 'cos normally you can mix HTTPS and HTTP without a problem Quote Link to comment Share on other sites More sharing options...
Aerion Posted July 25, 2017 Share Posted July 25, 2017 I too would like to be able to manipulate one selected vertex along with multiple selected vertices on a mesh as well! <3 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 25, 2017 Author Share Posted July 25, 2017 I think the code is in there in elevationControl.js Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 25, 2017 Share Posted July 25, 2017 Correct..and demo fixed:) thanks! Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 26, 2017 Author Share Posted July 26, 2017 I added the World Monger code to Decal Cat but I can't get it to work :/ I'm stuck at getting the picker working. pointer down will register but the picker returns a NULL mesh. https://www.babylonjs-playground.com/#1BAPRM#102 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 28, 2017 Author Share Posted July 28, 2017 I discovered that the imported mesh is not pickable. So I set isPickable to true, but the mesh still doesn't register as picked https://www.babylonjs-playground.com/#1BAPRM#103 References to canvas, scene and cat are all valid. I'm totally stumped! Quote Link to comment Share on other sites More sharing options...
Arte Posted July 28, 2017 Share Posted July 28, 2017 Hi ozRocker, Is this what you are looking for? "CAT IS PICKED! Line 60-61-62" https://www.babylonjs-playground.com/#1BAPRM#104 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 28, 2017 Author Share Posted July 28, 2017 14 minutes ago, Arte said: Hi ozRocker, Is this what you are looking for? "CAT IS PICKED! Line 60-61-62" https://www.babylonjs-playground.com/#1BAPRM#104 Yes! Thank you It looks like I needed to use scene.pointerX instead of evt.clientX Now I need to get the vertices moving when I click on them. I have a selected vertices array, but they aren't moving anywhere https://www.babylonjs-playground.com/#1BAPRM#106 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 28, 2017 Share Posted July 28, 2017 Just a thought is your mesh created as updatable? Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 29, 2017 Author Share Posted July 29, 2017 6 hours ago, JohnK said: Just a thought is your mesh created as updatable? I can't find anywhere how to make a mesh updatable :/ This is Schrödinger's cat that's on the Babylonjs server so its not my mesh. What's the command to make it updatable? Apologies if this is a dumb question but I've searched the doco and read the forum posts Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 29, 2017 Author Share Posted July 29, 2017 I think I got it. I added these lines cat.setVerticesData(BABYLON.VertexBuffer.PositionKind, cat.getVerticesData(BABYLON.VertexBuffer.PositionKind), true); cat.setVerticesData(BABYLON.VertexBuffer.NormalKind, cat.getVerticesData(BABYLON.VertexBuffer.NormalKind), true); https://www.babylonjs-playground.com/#1BAPRM#107 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 31, 2017 Author Share Posted July 31, 2017 hello @Deltakosh is there any documenation on the WorldMonger file by any chance? I think it would be possible to reverse-engineer then figure out how to apply it to different axis, but any existing documentation would help me a lot Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted August 1, 2017 Share Posted August 1, 2017 I also remember @RaananW playing with shaders long time ago : http://www.babylonjs-playground.com/#19NUUR http://www.babylonjs-playground.com/#19NUUR#1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 1, 2017 Share Posted August 1, 2017 No documentation (only code). It was done more as a demo than as a learning tool 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.