Camera增加一堆默认向量

This commit is contained in:
2019-06-11 16:18:49 +08:00
parent 0516bef44c
commit 9bab8a97f1
5 changed files with 15 additions and 25 deletions

View File

@@ -49,13 +49,8 @@ private:
void InitCamera()
{
camera.type=CameraType::Perspective;
camera.center.Set(0,0,0);
camera.eye.Set(100,100,100);
camera.up_vector.Set(0,0,1);
camera.forward_vector.Set(0,1,0);
camera.znear=4;
camera.zfar=1000;
camera.fov=90;
camera.center.Set(0,0,0,1);
camera.eye.Set(100,100,100,1);
camera.width=SCREEN_WIDTH;
camera.height=SCREEN_HEIGHT;

View File

@@ -14,8 +14,8 @@
using namespace hgl;
using namespace hgl::graph;
constexpr uint32_t SCREEN_WIDTH=1280;
constexpr uint32_t SCREEN_HEIGHT=960;
constexpr uint32_t SCREEN_WIDTH=128;
constexpr uint32_t SCREEN_HEIGHT=128;
vulkan::Renderable *CreateMeshRenderable(SceneDB *db,vulkan::Material *mtl,const MeshData *mesh)
{
@@ -119,18 +119,13 @@ private:
math::vec center_point=model_data->bounding_box.CenterPoint();
math::vec max_point=model_data->bounding_box.maxPoint;
max_point.x*=3.0f;
max_point.x*=2.0f;
max_point.y=center_point.y;
max_point.z=center_point.z;
camera.type=CameraType::Perspective;
camera.center=center_point.xyz();
camera.eye=max_point.xyz();
camera.up_vector.Set(0,0,1);
camera.forward_vector.Set(0,1,0);
camera.znear=4;
camera.zfar=1000;
camera.fov=90;
camera.center=center_point;
camera.eye=max_point;
camera.width=SCREEN_WIDTH;
camera.height=SCREEN_HEIGHT;

View File

@@ -21,7 +21,7 @@ using namespace hgl::graph;
class VulkanApplicationFramework
{
private:
private:
Window * win =nullptr;
vulkan::Instance * inst =nullptr;