Jump to content

0.9.7 Camera Projection Issue?


OneHitWonder
 Share

Recommended Posts

Hello,

I am not sure if this is intended behaviour but I was unable to locate any documentation on it so I am raising it here. There are two issues, one being related to the camera projection the other is a scene hierarchical issue with the camera but might also be relevant to other entities. 

  1. Creating a camera as a child of another entity will mess up the projection. Here is my scene displayed in the editor vs how it looks through the camera's projection. Moving the camera to the root of the scene will display correctly.
    image.thumb.png.2022829b90ff7e33ae9fc90e514778d9.pngimage.thumb.png.ef745bfbf8c3093494b1b26558d8e702.pngimage.thumb.png.0c24fba8b5662d0e297d3a3efde1c066.png
     
  2. When creating a camera entity in the Scene Hierarchy with another entity selected it will create it as a child which is expected but it will first place that camera in the Entities subfolder until you reload your map then it will display as a child of the selected parent. I would prefer to manage my Scene Hierarchy myself and not that those default folders.
Link to comment
Share on other sites

  • 3 weeks later...

I cannot reproduce this error in code. I would like to see the scene file so I can check of the parent entity is scaled.

#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_CLIENTCOORDS | WINDOW_CENTER | WINDOW_TITLEBAR);

    //Create a framebuffer
    auto framebuffer = CreateFramebuffer(window);

    //Create a world
    auto world = CreateWorld();

    //Environment maps
    auto specmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/specular.dds");
    auto diffmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/diffuse.dds");
    world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR);
    world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE);

    //Add a floor
    auto floor = CreateBox(world, 5, 1, 5);
    floor->SetPosition(0, -0.5, 0);

    auto box = CreateBox(world);
    box->SetPosition(0, 0.5, 0);

    auto camera = CreateCamera(world);
    camera->Move(0, 1, -3);
    camera->SetParent(box);
    
    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...