Page 1 of 1

How to make hill smoothly ?

Posted: Wed May 18, 2016 1:53 pm
by qq200600
CGO`HRZEMI@9OO]T%1$AIJV.png
CGO`HRZEMI@9OO]T%1$AIJV.png (18.81 KiB) Viewed 17178 times
I have make a hill with the RUBE, and How to make the hill smooth? It is chainShape. I know make the hill smoothly, I have to add more vertex, but is there a way to Automatic generate some more vertex make the hill smoothly ? Thank you

Re: How to make hill smoothly ?

Posted: Wed May 18, 2016 3:51 pm
by qq200600
Hi, sir. I found a algorithm : http://www.deluge.co/?q=benzier-curves

and I put the chianshape vertex into the algorithm

Code: Select all

ArrayList<SplineVertex> arrayList = new ArrayList<SplineVertex>();

        for (int i = 0; i < vertexs.size / 3; i++){
            arrayList.add(new SplineVertex(
                            new Vertex(vertexs.get(i * 3 + 1).cpy()),
                            new Vertex(vertexs.get(i * 3).cpy()),
                            new Vertex(vertexs.get(i * 3 + 2).cpy())
                    )
            );
        }

        spline = new Spline(arrayList);
        spline.refine(0);
and before the algorithm, the hill like this:
before.png
before.png (77.29 KiB) Viewed 17174 times
and after the algorithm, the hill like this:
after.jpg
after.jpg (18.71 KiB) Viewed 17174 times
And How to use the algorithm in the RUBE editor ? please help me. Thank you, sir. I am waitting for your reply.

Re: How to make hill smoothly ?

Posted: Thu May 19, 2016 9:01 am
by iforce2d
Maybe the 'Smooth vertices' or 'Bevel edges' scripts might be useful?

Smooth vertices: https://www.youtube.com/watch?v=K-VzlEtXdJM#t=33m52s
Bevel edges: https://www.youtube.com/watch?v=K-VzlEtXdJM#t=37m20s

Re: How to make hill smoothly ?

Posted: Thu May 19, 2016 9:36 am
by qq200600
iforce2d wrote:Maybe the 'Smooth vertices' or 'Bevel edges' scripts might be useful?

Smooth vertices: https://www.youtube.com/watch?v=K-VzlEtXdJM#t=33m52s
Bevel edges: https://www.youtube.com/watch?v=K-VzlEtXdJM#t=37m20s
HI, The Smooth line is good. But I have to add Vertexs by Manually, and then use the 'Smooth line'. I should be ok. Thank you