def object_transformations(self):
        objects_file = open(self.path_file_objects.encode('utf-8'), 'rU')

        read = list(csv.reader(objects_file, delimiter=";"))
        for raw in read[1:]:
            object = Object()
            object.name = raw[0]
            object.type = raw[1]
            object.category = raw[2]
            object.localization = raw[3]
            object.room = raw[4]
            object.color = raw[5]
            object.shape = raw[6]
            object.size = raw[7]
            object.weight = raw[8]

            self.objects.append(object)
Exemple #2
0
 def __init__(self, camera, cube_obj):
     self.camera = camera
     self.cubes = []
     self.directions = []
     self.cube_obj = cube_obj
     position = [randint(-10, 10) / 10, 0, randint(-10, 10) / 10]
     for i in range(40):
         cube = Object(self.cube_obj, self.camera, None)
         cube.scale(0.02, 0.02, 0.02)
         cube.color = [
             randint(-10, 10) / 10,
             randint(-10, 10) / 10,
             randint(-10, 10) / 10
         ]
         cube.translate(*position)
         self.cubes.append(cube)
         self.directions.append([
             randint(-10, 10) / 500,
             randint(-10, 10) / 500,
             randint(-10, 10) / 500
         ])