当前位置: 首页>>代码示例>>Python>>正文


Python World.buildEllipse方法代码示例

本文整理汇总了Python中world.World.buildEllipse方法的典型用法代码示例。如果您正苦于以下问题:Python World.buildEllipse方法的具体用法?Python World.buildEllipse怎么用?Python World.buildEllipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在world.World的用法示例。


在下文中一共展示了World.buildEllipse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: redrawFunnelsButton

# 需要导入模块: from world import World [as 别名]
# 或者: from world.World import buildEllipse [as 别名]
    def redrawFunnelsButton(self, change=True):
        if self.funnels_toggle:
            variance_x = 1.5 + abs(self.XVelocity_drawing*0.1)
            variance_y = 1.5 + abs(self.YVelocity_drawing*0.1)
            variance_z = 1.5 + abs(self.ZVelocity_drawing*0.1)

            #self.ActionSet.computeAllPositions(self.XVelocity_drawing,self.YVelocity_drawing,self.ZVelocity_drawing)

            #find almost equally spaced indexes
            indices_to_draw = np.zeros(10)
            
            indices_to_draw[0] = 0
            next_time = 0 + self.ActionSet.t_f/10.0

            number = 0
            for index, value in enumerate(self.ActionSet.overall_t_vector):
                if value > next_time:
                    indices_to_draw[number] = index
                    number = number + 1
                    next_time = next_time + self.ActionSet.t_f/10.0

            for index, value in enumerate(indices_to_draw):
                time = self.ActionSet.overall_t_vector[value]
                x_center = self.ActionSet.pos_trajectories[self.funnel_number,0,value]
                y_center = self.ActionSet.pos_trajectories[self.funnel_number,1,value]
                z_center = self.ActionSet.pos_trajectories[self.funnel_number,2,value]
                World.buildEllipse(index, [x_center,y_center,z_center], variance_x*time, variance_y*time, variance_z*time, alpha=0.3)
开发者ID:peteflorence,项目名称:DirectSim,代码行数:29,代码来源:CarSimulator.py

示例2: onDrawFunnelsButton

# 需要导入模块: from world import World [as 别名]
# 或者: from world.World import buildEllipse [as 别名]
    def onDrawFunnelsButton(self, change=True):

        if change == True:
            self.funnel_number_x = self.funnel_number_x + 1

            if self.funnel_number_x == 5:
                self.funnel_number_x = 0
                self.funnel_number_y = self.funnel_number_y + 1
                if self.funnel_number_y == 5:
                    self.funnel_number_y = 0

        print "I pressed the draw funnels button"
        variance_x = 1.5 + abs(self.XVelocity_drawing*0.1)
        variance_y = 1.5 + abs(self.YVelocity_drawing*0.1)
        variance_z = 0.2

        self.ActionSet.computeAllPositions(self.XVelocity_drawing,self.YVelocity_drawing)
        print np.shape(self.ActionSet.p_x_trajectories), "is my shape"

        for i in xrange(np.size(self.ActionSet.p_x_trajectories,1)):
            print i
            x_center = self.ActionSet.p_x_trajectories[self.funnel_number_x,i]
            y_center = self.ActionSet.p_y_trajectories[self.funnel_number_y,i]
            print x_center, y_center
            World.buildEllipse(i, [x_center,y_center,0], variance_x*i/10.0*0.5, variance_y*i/10.0*0.5, variance_z, alpha=0.3)
开发者ID:peteflorence,项目名称:DirectSim,代码行数:27,代码来源:CarSimulator.py

示例3: drawChosenFunnel

# 需要导入模块: from world import World [as 别名]
# 或者: from world.World import buildEllipse [as 别名]
    def drawChosenFunnel(self):
        velocity_initial_x = self.stateOverTime[self.currentIdx,2]
        velocity_initial_y = self.stateOverTime[self.currentIdx,3]

        variance_x = 2.5 + abs(velocity_initial_x*0.1)
        variance_y = 2.5 + abs(velocity_initial_y*0.1)
        variance_z = 1.5

        x_index = self.actionIndicesOverTime[self.currentIdx,0]
        y_index = self.actionIndicesOverTime[self.currentIdx,1]

        for i in xrange(0,10):
            time = 0.5/10.0*i
            x_center = self.ActionSet.p_x_trajectories[x_index, i]
            y_center = self.ActionSet.p_y_trajectories[y_index, i]
            z_center = 0.0
            World.buildEllipse(i, [x_center,y_center,z_center], variance_x*time, variance_y*time, variance_z*time, alpha=0.3)
开发者ID:peteflorence,项目名称:DirectSim,代码行数:19,代码来源:CarSimulator.py


注:本文中的world.World.buildEllipse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。