Sign in to follow this  

[c++] join points in hourglass direction

This topic is 2793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
...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?

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ,[b]all[b] 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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 2793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this