-
Notifications
You must be signed in to change notification settings - Fork 0
/
world.py
39 lines (28 loc) · 835 Bytes
/
world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class World:
def __init__(self, width, height, lights=None, objects=None, camera=None, planes=None):
self.width = width
self.height = height
if camera:
self.camera = camera
else:
self.camera = []
if lights:
self.lights = lights
else:
self.lights = []
if objects:
self.objects = objects
else:
self.objects = []
if planes:
self.planes = planes
else:
self.planes = []
def add_camera(self, position):
self.camera = position
def add_plane(self, object):
self.planes.append(object)
def add_object(self, object):
self.objects.append(object)
def add_light(self, light):
self.lights.append(light)