Using camera
auto s= Director::getInstance()->getWinSize();
auto camera= Camera::createPerspective(60, (GLfloat)s.width/s.height, 1, 1000);

// set parameters for camera
camera->setPosition3D(Vec3(0, 100, 100));
camera->lookAt(Vec3(0, 0, 0), Vec3(0, 1, 0));

addChild(camera); // add camera to the scene
Creating orthogonal camera
auto s= Director::getInstance()->getWinSize();
auto camera= Camera::createOrthographic(s.width, s.height, 1, 1000);
Hide objects from camera
// camera
camera->setCameraFlag(CameraFlag::USER1);

// node
node->setCameraMask(CameraFlag::USER1);
2015/12/10 17:28 2015/12/10 17:28

Trackback Address >> 이 글에는 트랙백을 보낼 수 없습니다

댓글을 달아 주세요