Dreikblack Posted Thursday at 03:35 PM Share Posted Thursday at 03:35 PM If you do "box->SetParent(pivot);" before loop there will be no shadow at all. In this example there is a shadow, but with Space box became child of rotating pivot and shadow is stay still static. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->Move(-1, 2, -6); //Create light auto light = CreatePointLight(world); light->SetPosition(0, 1, 0); light->SetColor(2); //Create ground auto ground = CreateBox(world, 20, 1, 20); ground->SetPosition(0, -0.5, 0); ground->SetColor(0, 0.4f, 0); auto pivot = CreatePivot(world); pivot->SetPosition(0, 0.5, -1); auto box = CreateBox(world, 1, 1, 1); box->SetPosition(0, 0.5, -1); while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { box->SetParent(pivot); } pivot->Turn(2); world->Update(); world->Render(framebuffer); } return 0; } 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.