[c++] join points in hourglass direction

Started by
8 comments, last by giugio 13 years, 11 months ago
Hy. I have a list of points in my application and i would join they in hourglass direction or in antihourglass direction. What is the alghoritm? thanks
Advertisement
...Sorry, what?

An hourglass is not a direction, and I can't even guess what an anti-hourglass is supposed to be.

Can you at least show what a "point" is in your code? What does it mean to "join" your points? Does the structure contain pointers that can point to other point objects, or do you want the list to handle that?
maybe "hourglass" means "clock"

Clockwise / counter-clockwise?

To the OP: welcome to the 21st century. We are using clocks and wrist-watches here for measuring time.

(So sorry, couldn't resist the cheap gag. And if you are talking about something else, then my gag is even an epic failure)
sorry for my english ,
My problem is to join points in clockwise/counter-clockwise for create walls in opengl.
I would start from a point(x,y,z coord) and join with the next clockwise/counterclockwise point and so one.

At the start i have only a list of 3d point and i would create a list of wall.

Thanks.
sorry again.
Haaa I hit it!

I don't think the problem is solvable. I mean it is possible to get the next clockwise/counter-clockwise point if we know the previous point (thus we already have a line segment), but what about junctions / dead-ends / self-intersecting /and a lot of other issues I can't think of at the moment?

Could you clarify a bit? Probably with drawing. Draw random points, and start to apply your method manually, and see how it goes.
If all the points in the list are known to be part of the wall (i.e., you don't have four walls, a floor, and a table all in one list), then you can just construct the convex hull in 2D. You have some choices as to how to go about this, depending on if the points are sorted in any way. The easiest way to start would be the Jarvis March - you can switch between clockwise and counter-clockwise easily. Once you have the convex hull, look into triangulation to turn it into something renderable.

The convex hull might possibly not use all the points in your list - if so, the interior points are still part of the same plane and won't make a difference. If they aren't part of the same plane (bumpy wall?), then take the leftover points and construct another convex hull, then connect the two by some triangulation. Repeat until you've used all the points, then triangulate the final, innermost hull.

If not all the points belong to the wall, then you have a much harder problem on your hands.
Yup, it seems I misunderstood the problem. I thought it's 2D, and the "walls" are line segments.
Quote:Original post by jouley
If all the points in the list are known to be part of the wall (i.e., you don't have four walls, a floor, and a table all in one list), then you can just construct the convex hull in 2D. You have some choices as to how to go about this, depending on if the points are sorted in any way. The easiest way to start would be the Jarvis March - you can switch between clockwise and counter-clockwise easily. Once you have the convex hull, look into triangulation to turn it into something renderable.

The convex hull might possibly not use all the points in your list - if so, the interior points are still part of the same plane and won't make a difference. If they aren't part of the same plane (bumpy wall?), then take the leftover points and construct another convex hull, then connect the two by some triangulation. Repeat until you've used all the points, then triangulate the final, innermost hull.

I see the convex hull on google.

If not all the points belong to the wall, then you have a much harder problem on your hands.


1)If all the points in the list are known to be part of the wall
yes all the points that i have are angles of wall and only part of the wall with angles that i must create.
But i can have more than a wall , i would join angle from start to end for create a wall ,then start from the precedent wall and join with the next angle for create next wall and so one for create the wall perimeter of a door.


2)My problem is that all the points vertex(the angles) are part of the walls , and i not discard any vertex also internal ,all the vertex must be connected for extract the poligon of the door.
very thanks.


thanks.

[Edited by - giugio on April 27, 2010 2:40:19 AM]
load them into a modeling program and connect them manually.

if the geomety is simple enough, maybe you're interested in the 3d convex hull?

you mentioned doors though so i doubt that's the case. in which case, you're basically hosed and people would pay big bucks for your algorithm since a log of modeling studios just manually create surfaces over point clouds. the exact thing you hope to do automatically.
Thanks , but i do it automatically .
You speak about convex hull , it connect all nodes for create a perimeter or discard any inner node?
I use wild magic4 engine and there is a class for convex hull then i can use it in case.
Thanks.

This topic is closed to new replies.

Advertisement