mirror of
https://github.com/Relintai/sfw.git
synced 2025-01-24 06:57:17 +01:00
MeshInstance test setup.
This commit is contained in:
parent
97841ab135
commit
9defe9d1c2
@ -100,20 +100,21 @@ void GameScene::render() {
|
|||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
static float rot = 0;
|
static float rot = 0;
|
||||||
|
|
||||||
camera->camera_transform.basis = Basis(Vector3(0, 1, 0), rot);
|
camera->camera_transform.basis = Basis(Vector3(0, 1, 0), rot);
|
||||||
|
|
||||||
rot += 0.01;
|
rot += 0.01;
|
||||||
|
|
||||||
camera->bind();
|
camera->bind();
|
||||||
|
|
||||||
//tile_map->render();
|
//tile_map->render();
|
||||||
|
|
||||||
//sprite->render();
|
//sprite->render();
|
||||||
|
|
||||||
//material->bind();
|
//material->bind();
|
||||||
color_material->bind();
|
//color_material->bind();
|
||||||
mesh->render();
|
//mesh->render();
|
||||||
|
|
||||||
|
static float rotmi = 0;
|
||||||
|
mi->transform.basis = Basis(Vector3(1, 0, 0), rotmi);
|
||||||
|
rotmi += 0.01;
|
||||||
|
mi->render();
|
||||||
|
|
||||||
//sprite->render();
|
//sprite->render();
|
||||||
}
|
}
|
||||||
@ -190,6 +191,17 @@ GameScene::GameScene() {
|
|||||||
MeshUtils::create_cone(mesh);
|
MeshUtils::create_cone(mesh);
|
||||||
mesh->upload();
|
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 width = 1;
|
||||||
//float height = 1;
|
//float height = 1;
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ public:
|
|||||||
|
|
||||||
Camera *camera;
|
Camera *camera;
|
||||||
Mesh *mesh;
|
Mesh *mesh;
|
||||||
|
MeshInstance *mi;
|
||||||
|
MeshInstance *mi2;
|
||||||
ColorMaterial *color_material;
|
ColorMaterial *color_material;
|
||||||
|
|
||||||
//ColoredMaterial *cmaterial;
|
//ColoredMaterial *cmaterial;
|
||||||
|
Loading…
Reference in New Issue
Block a user