Create new Camera

Hi.

I'm trying to create a new camera without success.

In DAZ Script IDE it works fine:

// Create a new cameravar oCam = new DzBasicCamera( );oCam.setName( "Test Camera" ); // Add the camera to the sceneScene.addNode( oCam );

 

DAZ SDK (from the documentation):

#include "dzcamera.h"DzCamera *cam = new DzBasicCamera(DzCamera::PERSPECTIVE_CAMERA);

I cannot find DzBasicCamera in any of the SDK's header files.

Is there any other way to add a camera to the scene?

 

Comments

  • Very strange.

    After restarting Visual Studio if was able to include dzbasiccamera.

    #include "dzbasiccamera.h"

     

  • Richard HaseltineRichard Haseltine Posts: 101,482
    edited March 2020

    In the SDK version you need to add the camera to the scene, as you do in the scripting exampleu. You also miss naming the camera. Rob supplies an example:

    DzCamera* cam = new DzBasicCamera();cam->setName( "Test Camera" );dzScene->addNode( cam );

    edited as I can't read

    Post edited by Richard Haseltine on
  • tonytony Posts: 0

    May I know where dzScene is initialized ?

    I am aware this is a global parameter, but my program is dying once it executes dzScene to do anything, and in the debugger, I found that its address is zero.

    By the way, I am playing SDK sapmle SceneLoaderApp.

    Thanks.

  • surrealsurreal Posts: 169

    Hi Tony,

    Read this thread https://www.daz3d.com/forums/discussion/comment/4949771/#Comment_4949771

    Hopefully it will help you understanding the SceneLoaderApp and why you are having problems.

Sign In or Register to comment.