Browse Source

Add a feature to generate a white noise background as init world

Yann Weber 6 years ago
parent
commit
8c6f2c78d9
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      gte/world.py

+ 5
- 0
gte/world.py View File

85
                 self._val = np.zeros([self._y, self._x])
85
                 self._val = np.zeros([self._y, self._x])
86
             else:
86
             else:
87
                 self._val = np.zeros([self._y, self._x, 3])
87
                 self._val = np.zeros([self._y, self._x, 3])
88
+        elif color == 'rand':
89
+            if self._gray:
90
+                self._val = np.random.randint(255, size=(self._y, self._x))
91
+            else:
92
+                self._val = np.random.randint(255, size=(self._y, self._x, 3))
88
         else:
93
         else:
89
             self._val = [[color for _ in range(self._x)] for _ in range(self._y)]
94
             self._val = [[color for _ in range(self._x)] for _ in range(self._y)]
90
             self._val = np.array(self._val)
95
             self._val = np.array(self._val)

Loading…
Cancel
Save