1161186f7f5bebaf83330cf1ba8ca1a4b70c4817
1 from itertools
import product
2 from panda3d
.core
import NodePath
8 root
= NodePath('background_root')
9 root
.reparent_to(render
)
11 start_size
, end_size
= 5, 2.5
13 for col
, row
in product(range(ncols
), range(nrows
)):
14 model
= loader
.load_model('assets/gltf/background/background.gltf')
15 model
.set_scale(end_size
/ start_size
)
16 model
.reparent_to(root
)
17 total_width
, total_height
= end_size
* ncols
, end_size
* nrows
18 left
, bottom
= -total_width
/2, -total_height
/2
19 model
.set_pos(left
+ end_size
* col
, -offset
, bottom
+ end_size
* row
)
20 root
.clear_model_nodes()