How to make hill smoothly ?

General discussion about the R.U.B.E editor
Post Reply
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

How to make hill smoothly ?

Post by qq200600 »

CGO`HRZEMI@9OO]T%1$AIJV.png
CGO`HRZEMI@9OO]T%1$AIJV.png (18.81 KiB) Viewed 17107 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
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make hill smoothly ?

Post 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 17103 times
and after the algorithm, the hill like this:
after.jpg
after.jpg (18.71 KiB) Viewed 17103 times
And How to use the algorithm in the RUBE editor ? please help me. Thank you, sir. I am waitting for your reply.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to make hill smoothly ?

Post 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
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make hill smoothly ?

Post 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
Post Reply