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](./download/file.php?id=174&sid=49323ca7ac2a5120ce5ba6205b8c16d2)
- CGO`HRZEMI@9OO]T%1$AIJV.png (18.81 KiB) Viewed 26121 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 (77.29 KiB) Viewed 26117 times
and after the algorithm, the hill like this:

- after.jpg (18.71 KiB) Viewed 26117 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
Re: How to make hill smoothly ?
Posted: Thu May 19, 2016 9:36 am
by qq200600
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