SpiderPig Posted February 12, 2023 Share Posted February 12, 2023 Certain vectors cause the entity to scale rapidly down to zero on a few axis. Below is one example. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1440, 900, displays[0]); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); auto camera = CreateCamera(world); camera->Move(0, 1, -3); camera->SetClearColor(1, 0, 0); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->size); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->size.x * 0.5f, (float)framebuffer->size.y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto label = CreateLabel("", 10, 10, 500, 200, ui->root); auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 35); auto box = CreateBox(world); Vec3 up = Vec3(1.0f, 1.0f, 1.0f).Normalize(); while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false) { box->AlignToVector(up, 1, 1.0f, 1.0f); auto scale = box->GetScale(); label->SetText("Scale : " + String(scale.x) + ", " + String(scale.y) + ", " + String(scale.z)); world->Update(); world->Render(framebuffer); } return 0; } 1 Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted February 17, 2023 Solution Share Posted February 17, 2023 The fix will be in the next update for 1.0.2. 1 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...
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.