MeshInstance test setup.

This commit is contained in:
Relintai 2023-12-20 09:54:01 +01:00
parent 97841ab135
commit 9defe9d1c2
2 changed files with 20 additions and 6 deletions

View File

@ -100,20 +100,21 @@ void GameScene::render() {
glClear(GL_COLOR_BUFFER_BIT);
static float rot = 0;
camera->camera_transform.basis = Basis(Vector3(0, 1, 0), rot);
rot += 0.01;
camera->bind();
//tile_map->render();
//sprite->render();
//material->bind();
color_material->bind();
mesh->render();
//color_material->bind();
//mesh->render();
static float rotmi = 0;
mi->transform.basis = Basis(Vector3(1, 0, 0), rotmi);
rotmi += 0.01;
mi->render();
//sprite->render();
}
@ -190,6 +191,17 @@ GameScene::GameScene() {
MeshUtils::create_cone(mesh);
mesh->upload();
mi = memnew(MeshInstance());
mi->material = color_material;
mi->mesh = mesh;
mi2 = memnew(MeshInstance());
mi2->material = color_material;
mi2->mesh = mesh;
mi2->transform.origin.x = 1;
mi->children.push_back(mi2);
//float width = 1;
//float height = 1;

View File

@ -44,6 +44,8 @@ public:
Camera *camera;
Mesh *mesh;
MeshInstance *mi;
MeshInstance *mi2;
ColorMaterial *color_material;
//ColoredMaterial *cmaterial;