• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
DonDickieD

Point inside convex polyhedron defined by planes

13 posts in this topic

Given a set of planes that define a convex polyhedron. I would need to quickly find an arbitrary point inside the polyhedron. Not necessarily, but ideally the centroid. I want to do this without any plane intersections if possible.

0

Share this post


Link to post
Share on other sites

You need to prove that your planes halfspaces define a non-empty convex polyhedron first; I don't think there are practical ways which don't involve intersecting planes and convex polyhedra and building explicit faces, edges and vertices (from which computing the centroid is easy).

0

Share this post


Link to post
Share on other sites
I haven't tested it, but maybe you can do this:

Your plane equations are: Ni*x-Di, with Ni normalized row vectors, Di are scalars, and x is a column vector.
Now minimize the sum of squared distances with respect to x: S=sum[(Ni*x-Di)^2]
Obtain: x=((sum[Ni^T*Ni])^+) * sum[Di*Ni^T]
I'm almost sure that the pseudo-inverse is not required (and you can take the regular inverse), because this reminds me a lot of SVD. However, this is just a hunch.

EDIT: Yup, the matrix should be invertible for any closed polyhedrons. No need for pseudo-inverse. Edited by max343
1

Share this post


Link to post
Share on other sites

You just need to check if the point is behind (ie half-spaces) every plane defining your volume. If so, the point is inside your volume

EDIT Sorry if it's not the point of your question

Edited by Tournicoti
0

Share this post


Link to post
Share on other sites

You just need to check if the point is behind (ie half-spaces) every plane defining your volume. If so, the point is inside your volume

Sure, but the question was how to find such a point that satisfies this criteria.

 

Thanks max343. I was thinking that this is a minimization problem, but I am bit rusty here.  I will look into this!

0

Share this post


Link to post
Share on other sites
BTW, sometimes it makes more sense to find the center of the circumscribed sphere rather than the centroid (which gives bias to clustered vertices). In this case you can do this:
1. Find x0 as I previously described.
2. Solve the weighted minimization problem with the weights: Wi = |Ni*x0-Di|
0

Share this post


Link to post
Share on other sites
This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.
0

Share this post


Link to post
Share on other sites

I wonder if there's some sort of "generalized barycentric coordinate" formulation to handle this scenario...

0

Share this post


Link to post
Share on other sites

This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.

I don't think that Simplex algorithm is the best choice here, since it searches for maximum on the boundary, while OP wanted some interior point.
0

Share this post


Link to post
Share on other sites


This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.

I don't think that Simplex algorithm is the best choice here, since it searches for maximum on the boundary, while OP wanted some interior point.


Please, read my post carefully. The simplex algorithm has two phases: Phase I finds a feasible configuration, and phase II improves the configuration to find the optimum value of the objective function. Phase I of the simplex algorithm is exactly the same problem the OP has.
0

Share this post


Link to post
Share on other sites
But the simplex algorithm doesn't search through interior points, just through the boundary. Phase I just finds a boundary vertex of the feasible region or returns that the problem is infeasible.
OP wanted something close to the centroid, this is distinctly an interior point.
0

Share this post


Link to post
Share on other sites

If you have a point at the boundary, finding one in the interior is pretty trivial. The wording of the first post says that he would be satisfied with that.

 

Maybe I missed it, but I don't think a better solution has been suggested so far... What you suggested returns the same answer if you flip one of the inequalities, so it can't possibly return something in the interior in both cases.

0

Share this post


Link to post
Share on other sites
I don't have inequalities in my solution. What I suggested disregards direction because it already assumes that the feasible region of the half spaces defines a convex polyhedron. If we'd flip one of the inequalities, the feasible region would be empty.
0

Share this post


Link to post
Share on other sites

I don't have inequalities in my solution. What I suggested disregards direction because it already assumes that the feasible region of the half spaces defines a convex polyhedron. If we'd flip one of the inequalities, the feasible region would be empty.

 

No, that's not how it works. Imagine you have a bunch of half-spaces that already define a convex polyhedron. Now take a plane that cuts that convex polyhedron through the middle, and either add one half-space or the other to the list. In both situations the feasible region is not empty, and your proposed solution will return the same answer.

Edited by Álvaro
0

Share this post


Link to post
Share on other sites

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  
Followers 0