Jump to content

Gizmo of transformation


Dad72
 Share

Recommended Posts

  • 2 weeks later...

I think that I will abandon, its fact four day that I have the nose in the handlebar. I do not know where to look, I not understand the code of WorldMonger, i don't know add a color. I despair.
I want good to add a color, but where and how? I want good to update the ground, but how? I won't get there without more precise help.

 

Thanks for your time

Link to comment
Share on other sites

Is this that its features will be presented in the future?

- Gizmo of transformation on the objects
- Brush with radius of color
- Smoothing of the terrain
- Change of texture of ground.

- Painting of the grass

- LOD ground (low, medium, higth)

That is what is missing to WorldMonger for having a terrain editor really cool. Please.

 

Thank You Deltakosh
 

Link to comment
Share on other sites

I am not able to do what I wanted to for the vertexes selected of color. So I have made with the particles that i've edit for me closer of what I wanted to do.

 

The changes made:

- The box and the numbers of particles increases when resizing the brush.
- The particles stops instantly when we do clicked more on the ground.

- The elevation of the ground is slower for more precision. and add a slider to regulate the speed of elevation.

- Readjustment of the position of the particles during the click on the ground.

 

I share what I have done:

 

In the constructor

   WORLDMONGER.ElevationControl = function (ground)        this._ground = ground;        this.radius = 5.0;                this._invertDirection = 1.0;        this.heightMin = -5.0;        this.heightMax = 30.0;         this.speed = 0.1;                              var particleSystem = new BABYLON.ParticleSystem("particles", 2700, ground.getScene());        particleSystem.particleTexture = new BABYLON.Texture("ba.jpg", ground.getScene());        particleSystem.minAngularSpeed = 0;        particleSystem.maxAngularSpeed = 0;        particleSystem.minSize = 0;        particleSystem.maxSize = 0;        particleSystem.minLifeTime = 0.2;        particleSystem.maxLifeTime = 0.2;        particleSystem.minEmitPower = 0.5;        particleSystem.maxEmitPower = 0.5;        particleSystem.emitRate = 400;        particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;        particleSystem.minEmitBox = new BABYLON.Vector3(0, 0, 0);        particleSystem.maxEmitBox = new BABYLON.Vector3(0, 0, 0);        particleSystem.direction1 = new BABYLON.Vector3(0, 1, 0);        particleSystem.direction2 = new BABYLON.Vector3(0, 1, 0);        particleSystem.color1 = new BABYLON.Color4(0, 0, 0.5, 1);        particleSystem.color2 = new BABYLON.Color4(0, 0, 0.5, 1);        particleSystem.gravity = new BABYLON.Vector3(0, 1, 0);        particleSystem.manualEmitCount = 0;        particleSystem.emitter = new BABYLON.Vector3(0, 0, 0);        particleSystem.start();                this._particleSystem = particleSystem;            };   

Add edit speed elevation :

WORLDMONGER.ElevationControl.prototype.speed = function(speed) {     this.speed = speed; };

in the "attachControl" event "_onBeforeRender":   

        this._onBeforeRender = function () {            if (!currentPosition) return;                        pickInfo = that._ground.getScene().pick(currentPosition.x, currentPosition.y);            if (!pickInfo.hit) return;            if (pickInfo.pickedMesh != that._ground) return;            that._particleSystem.emitter = pickInfo.pickedPoint.add(new BABYLON.Vector3(-that.radius / 2, 0, -that.radius / 2));                        that._particleSystem.maxEmitBox = new BABYLON.Vector3(that.radius, that.radius, that.radius);            that._particleSystem.minSize = that.radius * 3;            that._particleSystem.maxSize = that.radius * 3;            that._particleSystem.manualEmitCount += 90 * that.radius;                                    that._elevateFaces(pickInfo, that.radius, that.speed);        };

It is a pity that this is not what I wanted to do at the beginning.

Link to comment
Share on other sites

  • 4 weeks later...

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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...