Josh Posted March 2 Share Posted March 2 Here you go. Just make sure you have indices as well as vertices: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); world->SetAmbientLight(1); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -1); auto model = CreateSphere(world); //Create point model auto model2 = CreateModel(world); std::vector<uint32_t> indices(model->lods[0]->meshes[0]->vertices.size()); for (int n = 0; n < indices.size(); ++n) indices[n] = n; auto mesh = CreateMesh(MESH_POINTS, model->lods[0]->meshes[0]->vertices, indices); model2->AddMesh(mesh); model = nullptr; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { model2->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; } 3 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted March 2 Share Posted March 2 Powerfull. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.