带方向的自定义地图
我想制作一个地图程序,为校园周围(宿舍、足球场等)和建筑物内(办公室、自助餐厅等)提供方向。 有什么现有的东西可以帮助促进这一点吗?
另一种选择似乎是我必须创建自己的校园周围的点和路径地图,并进行路径查找。
编辑:澄清一下,我想知道如何将空间意识添加到寻路程序中,以便生成路径的步行方向。 示例:对于充满办公室的走廊,有两个允许路径进入走廊的节点,您如何知道某个办公室是否位于一个节点的左侧和另一个节点的右侧?
I want to make a map program that gives directions around a campus (residence halls, football field, etc), and within buildings (to offices, cafeteria, etc). Is there anything existing that would help facilitate that?
The alternative seems to be that I would have to create my own map of points and paths around campus and do path-finding for directions.
EDIT: To clarify, I'm wanting to know about how to add spatial awareness to a pathfinding program, in order to generate walking directions for the path. Example: for a hallway full of offices that has two nodes that allow a path to enter the hallway, how do you know if a certain office is on the left from one node and on the right from another?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我使用多边形作为节点而不是路径点,我可以创建一个可用于寻路和方向的导航网格。 对于方向和使用矩形节点,如果我给出从顶部顺时针方向从 1 到 4 的边的矩形编号,我知道如果我进入边 2 并离开边 1,则这是一个右转。 或者,如果我进入第 3 边(例如底部)并离开第 4 边,则它是左侧。
If I use polygons for the nodes instead of waypoints, I can create a navigation mesh that can be used for pathfinding and directions. For directions and using a rectangle node, if I give the rectangle numbers for its sides from 1 to 4 going clockwise from the top, I know that if I enter side 2 and leave side 1, it's a right hand turn. Or, if I enter side 3 (say, the bottom) and leave side 4, it's a left.
如果不知道你想要什么样的界面,这个问题很难回答。 它应该是一个谷歌地图类型的应用程序吗? 或者更简单的东西? 无论什么事情你可能都必须定义路径——什么事情是无法通过的。
你可以做很多工作并定义什么是不可通行的,然后使用寻路算法穿过草坪; 但这比简单的方法需要更多的工作:
This is pretty hard to answer without knowing what sort of interface you want. Is it supposed to be a Google Maps-type application? Or something simpler? No matter what you're probably going to have to define paths - what things are impassable.
You could do a lot of work and define what's impassable and then use a path-finding algorithm to walk across lawns; but that'd be more work than the simple approach: