roadgen.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:derplearning 作者: John-Ellis 项目源码 文件源码
def poly_noise(self, origin, max_size=[128,24],  max_verticies=10):
        vert_count = np.random.randint(3,max_verticies)
        verts = np.matmul(np.ones([vert_count+1, 1]), [origin] )
        verts[1:vert_count, 0] = origin[ 0] + np.random.randint(0, max_size[0], vert_count -1)
        verts[1:vert_count, 1] = origin[ 1] + np.random.randint(0, max_size[1], vert_count -1)

        return polygon(verts[:,1], verts[:,0], (self.view_res[1], self.view_res[0]) )

    #converts coordinates into images with curves on them
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号