Dad72 Posted February 19, 2014 Share Posted February 19, 2014 Hi, That is why I talked about the feature 'smooth' on the ground. I wanted to flatten parts of ground and the edges are in saw tooth. With a brush smooth, this lisserais the edges. You can see on my screen copy : This project shalt distribute freely in the future. Thanks Xanmia 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2014 Share Posted February 19, 2014 For me this is beyond the scope of babylon.js Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 19, 2014 Author Share Posted February 19, 2014 I speak of worldmonger which can have this functionality for the completed. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 19, 2014 Author Share Posted February 19, 2014 And I would add also: Worldmonger is actually part of Babylon.js ? Why worldmonger can high the vertex but cannot smooth the vertex high ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2014 Share Posted February 19, 2014 Worldmonger is just a technical demo of babylon.js AFAC Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 19, 2014 Author Share Posted February 19, 2014 That is what AFAC ? Yes, agreed. But it would be interesting to complement this demo technic to make a small product more finished.This would help me to understand how to make that my project leads to something presentable. Without this, my project will not see the day and this shalt be 1 years of lost work for me, because my project canst not be circulated to the public without its features that I do not feel capable of achieving: "smooth", "paint texture", "radius brush visible". That is all that is missing to worldmonger.Thank you for your attention. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 19, 2014 Author Share Posted February 19, 2014 I just see: the particles no longer works on the demo of WorldMonger.I know I am casse pied Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2014 Share Posted February 19, 2014 It works for me Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 19, 2014 Author Share Posted February 19, 2014 Ah yes, this re works .just now, I had no particle. Sorry That is what AFAC ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 20, 2014 Share Posted February 20, 2014 Beautiful GUI/IDE, dad72! Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 20, 2014 Author Share Posted February 20, 2014 Thank you Wingnut. It is a pleasure to have opinions.I hope the distribute a day and be of benefit to the community. Unfortunately, I have not yet integrated into the English language in it, but the system multi-language is present. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 20, 2014 Share Posted February 20, 2014 It was AFAIC : As far as I'm concerned Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 20, 2014 Author Share Posted February 20, 2014 Is this that someone has an idea of how smooth the ground? I used the demo of WorldMonger. Thanks Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 It would seem that nobody knows the answer, this must be too complicate for everyone....I have more that has shut down my project.... I cannot consider restart with another engine. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 I understand your problem but if you need to smooth the geometry you have to add vertices on your object Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 Thank you for your reply. But that is what allows you to add vertices to the ground? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 Actually when you update the ground you have two options:- just add more vertices at ground's creation: it will allow you to smooth the edges without doing nothing else- change the code you use to update the ground : could you link it here? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 I used the demo WorldMonger. I think that is in _elevateFaces which elevate vertices.WORLDMONGER.ElevationControl.prototype._elevateFaces = function (pickInfo, radius, height) { this._prepareDataModelForElevation(); this._selectedVertices = []; // Impact zone var sphereCenter = pickInfo.pickedPoint, index; sphereCenter.y = 0; // Determine list of vertices for (var subIndex = 0; subIndex < this._ground.subMeshes.length; subIndex++) { var subMesh = this._ground.subMeshes[subIndex]; if (!this._isBoxSphereIntersected(subMesh.getBoundingInfo().boundingBox, sphereCenter, radius)) continue; for (index = subMesh.verticesStart; index < subMesh.verticesStart + subMesh.verticesCount; index++) { var position = this._groundPositions[index]; sphereCenter.y = position.y; var distance = BABYLON.Vector3.Distance(position, sphereCenter); if (distance < radius) { this._selectedVertices[index] = distance; } } } // Elevate vertices for (var selectedVertice in this._selectedVertices) { var position = this._groundPositions[selectedVertice]; var distance = this._selectedVertices[selectedVertice]; var fullHeight = height * this.direction * this._invertDirection; if (distance < radius * 0.3) position.y += fullHeight; else { position.y += fullHeight * (1.0 - (distance - radius * 0.3) / (radius * 0.7)); } if (position.y > this.heightMax) position.y = this.heightMax; else if (position.y < this.heightMin) position.y = this.heightMin; this._groundVerticesPositions[selectedVertice * 3 + 1] = position.y; this._updateSubdivisions(selectedVertice); } // Normals this._reComputeNormals(); // Update vertex buffer this._ground.updateVerticesData(BABYLON.VertexBuffer.PositionKind, this._groundVerticesPositions); this._ground.updateVerticesData(BABYLON.VertexBuffer.NormalKind,this._groundVerticesNormals); }; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 This line is the key:if (distance < radius * 0.3) position.y += fullHeight; else { position.y += fullHeight * (1.0 - (distance - radius * 0.3) / (radius * 0.7)); } if you need to smooth things up, just add a small variable there:if (distance < radius * 0.1) position.y += fullHeight * 0.5; else { position.y += 0.5 * fullHeight * (1.0 - (distance - radius * 0.1) / (radius * 0.9)); } Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 Ah, ok? I was not far away. i suspected of or i have had to change, but I don't know how change.Thank You DeltaKosh, I will check that. This to me is a great help. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 This changes nothing, it elevate the vertices and not smooth. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 So try to add more vertices when creating the ground Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 I cannot do the loading of the field. Because I saved in a json file any change of vertices and when i reloaded, it is the file that is read to generate the ground. If I added a subdivision, the file no longer corresponds to the number of vertices. I would like the users of my editor can have a smoothing tool while he edited the ground. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 this is a physic limitation with 100 vertices you can get a smooth effect :0 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2014 Author Share Posted February 21, 2014 I am sorry, I do not understand: "with 100 vertices you can get a smooth effect :0" 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.