commit 6c562ef99296e2bedb2494551402ab7fc58a1172
parent d9e8b3450400c825afa81b631de1a66a79a443ef
Author: William Casarin <jb55@jb55.com>
Date: Tue, 2 Jul 2019 17:14:32 -0700
single rock procmesh
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/scene.c b/src/scene.c
@@ -75,22 +75,26 @@ void entity_test_scene(struct game *game)
struct entity *player = get_player(&game->test_resources);
struct terrain *terrain = &game->terrain;
player->model_id = get_static_model(model_pirate_officer, NULL);
+ model_id proc_id;
+ init_model_id(&proc_id);
+
+ struct model *pmodel = new_model(&proc_id); assert(pmodel);
+ struct geometry *geom = get_geometry(&pmodel->geom_id); assert(geom);
+ proc_sphere(geom);
+ pmodel->shading = SHADING_VERT_COLOR;
for (int i = 0; i < 500; i++) {
struct entity *ent = new_entity(NULL);
struct node *node = get_node(&ent->node_id);
- struct model *pmodel = new_model(&ent->model_id); assert(pmodel);
- struct geometry *geom = get_geometry(&pmodel->geom_id); assert(geom);
-
- proc_sphere(geom);
- pmodel->shading = SHADING_VERT_COLOR;
+ ent->model_id = proc_id;
double x = rand_0to1() * terrain->size;
double y = rand_0to1() * terrain->size;
double z = terrain->fn(terrain, x, y);
node_scale(node, 10.0);
+ node_rotate(node, V3(rand_0to1(),rand_0to1(),rand_0to1()));
node_translate(node, V3(x, y, z));
node_recalc(node);