瀏覽代碼

glTF 2.0: Set camera "look at" to (0.0, 0.0, -1.0).

Axel Wefers 7 年之前
父節點
當前提交
4235765856
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      code/glTF2Importer.cpp

+ 3 - 0
code/glTF2Importer.cpp

@@ -499,6 +499,9 @@ void glTF2Importer::ImportCameras(glTF2::Asset& r)
 
 
         aiCamera* aicam = mScene->mCameras[i] = new aiCamera();
         aiCamera* aicam = mScene->mCameras[i] = new aiCamera();
 
 
+        // cameras point in -Z by default, rest is specified in node transform
+        aicam->mLookAt = aiVector3D(0.f,0.f,-1.f);
+
         if (cam.type == Camera::Perspective) {
         if (cam.type == Camera::Perspective) {
 
 
             aicam->mAspect        = cam.cameraProperties.perspective.aspectRatio;
             aicam->mAspect        = cam.cameraProperties.perspective.aspectRatio;