def arena_update(self): # Weird squence is due to arena.Object implementation if self.active: self.thickline = arena.Thickline(line_width=self.line_width, color=self.activeColor, path=self.get_path()) self.update() else: self.thickline = arena.Thickline(line_width=1, color=self.baseColor, path=self.get_path()) self.update()
def draw_ray(click_pos, position): global delete_object_queue global pinata_loc click = arena.Object( scale=(0.1, 0.1, 0.1), location=(pinata_loc[0], pinata_loc[1], pinata_loc[2]), data= '{"material": { "transparent": true, "opacity": 0 },"sound":{"positional":true,"poolSize":1,"src":"store/users/wiselab/audio/glass.oga","autoplay":"true"}}' ) delete_object_queue.append(click) random_number = random.randint(0, 16777215) rand_color = str(hex(random_number)) rand_color = '#' + rand_color[2:] line = arena.Object( #ttl=1, DON'T USE THIS FOR high traffic objects since it uses the DB! # Have a harvester thread above instead objType=arena.Shape.thickline, thickline=arena.Thickline( # slightly below camera so you can see line vs head-on { (click_pos[0],click_pos[1]-0.2,click_pos[2]), (position[0],position[1],position[2]) },5,rand_color) ) delete_object_queue.append(line)
def draw_ray(click_pos, position): line = arena.Object( ttl=1, objType=arena.Shape.thickline, thickline=arena.Thickline( # slightly below camera so you can see line vs head-on { (click_pos[0],click_pos[1]-0.2,click_pos[2]), (position[0],position[1],position[2]) },5,"#FF00FF") )
def draw_ray(event=None): if event.event_type == arena.EventType.mousedown: line = arena.Object( objType=arena.Shape.thickline, thickline=arena.Thickline( # slightly below camera so you can see line vs head-on { (event.click_pos[0],event.click_pos[1]-0.1,event.click_pos[2]-0.1), (event.position[0],event.position[1],event.position[2]) },5,"#FF0000") ) ball = arena.Object(objType=arena.Shape.sphere, location=(event.position[0], event.position[1], event.position[2]), scale=(0.05, 0.05, 0.05), color=(255, 0, 0)) delete_object_queue.append(line) delete_object_queue.append(ball)
def __init__(self, objName="link", objType=arena.Shape.thickline, line_width=5, color=(200, 0, 0), activeColor=(0, 200, 200), objects=None # opacity=1, ): self.line_width = line_width self.baseColor = color self.activeColor = activeColor self.objects = objects self.active = False path = self.get_path() if self.objects else [(0, 1, 1), (0, 1, -1)] super().__init__(objName=objName, objType=objType, color=color, thickline=arena.Thickline(line_width=line_width, color=color, path=path))
rotation=(0.25, 0.25, 0.25, 1), color=(255, 0, 0), ) input("") arena.Object( objName="line1", objType=arena.Shape.line, line=arena.Line(start=(3, 2, -4), end=(3, 3, -4), color=(206, 0, 255)), ) input("") arena.Object( objName="line2", objType=arena.Shape.thickline, thickline=arena.Thickline(line_width=11, color=(255, 136, 238), path=[ (3, 4, -4), (4, 4, -4), (4, 5, -4), (4, 5, -5)]), ) input("") torus.update(physics=arena.Physics.dynamic) input("") torus.update(ttl=2) input("") # trick: obtain an arena.py Object for an already-existing global scene object named "cameraRig" # in order to update it's data attributes rig = arena.Object(objName="cameraRig") rig.update( data='{"animation": {"property": "position", "to": "0 10 20", "easing": "linear", "dur": 1000}}') input("")