/* -------------------------------------------------------
				checkerBoardCameraCalibration
   ------------------------------------------------------- */
bool mrpt::vision::checkerBoardCameraCalibration(
	TCalibrationImageList &images,
	unsigned int  check_size_x,
	unsigned int  check_size_y,
	double        check_squares_length_X_meters,
	double        check_squares_length_Y_meters,
	CMatrixDouble33			&intrinsicParams,
	std::vector<double>		&distortionParams,
	bool					normalize_image,
	double            *out_MSE,
	bool               skipDrawDetectedImgs,
	bool			   useScaramuzzaAlternativeDetector
	)
{
	// Just a wrapper for the newer version of the function which uses TCamera:
	TCamera  cam;
	bool ret = checkerBoardCameraCalibration(
		images,
		check_size_x,check_size_y,
		check_squares_length_X_meters, check_squares_length_Y_meters,
		cam,
		normalize_image,
		out_MSE,skipDrawDetectedImgs,
		useScaramuzzaAlternativeDetector);

	intrinsicParams = cam.intrinsicParams;
	distortionParams = cam.getDistortionParamsAsVector();
	return ret;
}
Example #2
0
void SkyBox::render(const TCamera& camera)
{
  assert( m_bInitialized );  
  
  if (m_cubemaps.empty())
  {
    fprintf(stderr, "ERROR : no cubemap specified\n");
    exit(0);
  }
  
  
  glDisable( GL_DEPTH_TEST );
  glDepthMask( GL_FALSE );  
  glDisable( GL_CULL_FACE );  
  
  glEnable( GL_TEXTURE_CUBE_MAP_SEAMLESS );  
  
  m_Program->bind();
  {    
    //-------------------------------------------------
    if (m_bAutoRotation)
    {
      m_spin = fmodf( m_spin+0.1f, 360.0f);
      glm::vec3 axis = glm::vec3( 1.0f, 0.7f, -0.5f );
      
      m_rotateMatrix = glm::rotate( glm::mat4(1.0f), m_spin, axis);
      m_invRotateMatrix = glm::mat3( glm::rotate( glm::mat4(1.0f), -m_spin, axis) );
    }
    //-------------------------------------------------
    
    // Vertex uniform
    glm::mat4 followCamera = glm::translate( glm::mat4(1.0f), camera.getPosition());
    glm::mat4 model = m_CubeMesh->getModelMatrix() * followCamera * m_rotateMatrix;
    glm::mat4 mvp = camera.getViewProjMatrix() * model;    
    m_Program->setUniform( "uModelViewProjMatrix", mvp);
    
    // Fragment uniform
    m_Program->setUniform( "uCubemap", 0);
    
    m_cubemaps[m_curIdx]->bind( 0u );
      m_CubeMesh->draw();    
    m_cubemaps[m_curIdx]->unbind( 0u );
  }
  m_Program->unbind();
  
  glDisable( GL_TEXTURE_CUBE_MAP_SEAMLESS );
     
  //glEnable( GL_CULL_FACE );
  glDepthMask( GL_TRUE );
  glEnable( GL_DEPTH_TEST ); 
  
  CHECKGLERROR();
}
void LevelCreatePopup::update() {
  updatePath();
  Preferences *pref = Preferences::instance();
  if (pref->isNewLevelSizeToCameraSizeEnabled()) {
    TCamera *currCamera =
        TApp::instance()->getCurrentScene()->getScene()->getCurrentCamera();
    TDimensionD camSize = currCamera->getSize();
    m_widthFld->setValue(camSize.lx);
    m_heightFld->setValue(camSize.ly);
    m_dpiFld->setValue(currCamera->getDpi().x);
  } else {
    m_widthFld->setValue(pref->getDefLevelWidth());
    m_heightFld->setValue(pref->getDefLevelHeight());
    m_dpiFld->setValue(pref->getDefLevelDpi());
  }

  int levelType = pref->getDefLevelType();
  int index     = -1;
  switch (levelType) {
  case TZI_XSHLEVEL:
    index = m_levelTypeOm->findText(ScanLevel);
    break;
  case PLI_XSHLEVEL:
    index = m_levelTypeOm->findText(VectorLevel);
    break;
  case TZP_XSHLEVEL:
    index = m_levelTypeOm->findText(ToonzLevel);
    break;
  case OVL_XSHLEVEL:
    index = m_levelTypeOm->findText(RasterLevel);
    break;
  }
  if (index >= 0) m_levelTypeOm->setCurrentIndex(index);

  /*
(old behaviour)
TCamera* camera = scene->getCurrentCamera();
  TDimensionD cameraSize = camera->getSize();
  m_widthFld->setValue(cameraSize.lx);
  m_heightFld->setValue(cameraSize.ly);
if(camera->isXPrevalence())
m_dpiFld->setValue(camera->getDpi().x);
else
m_dpiFld->setValue(camera->getDpi().y);
*/
}
Example #4
0
bool TSceneTree::setCamera (Gtk::Tree* ptTREE)
{
  
  Gtk::TreeItem*   ptItem;
  Gtk::Tree*       ptSubtree;
  TCamera*        ptCamera;
  
  ptCamera = ptScene->camera();
  if ( ptCamera )
  {
    ptSubtree = new Gtk::Tree;

    string entry_name;
    if(!ptCamera->identifier().empty())
    {
      entry_name = ptCamera->identifier() + " [" + ptCamera->className() + ']';
    }
    else
    {
      entry_name = ptCamera->className();
    }
    
    ptItem = new Gtk::TreeItem (entry_name);
    ptItem->show();
    ptSubtree->append (*ptItem);

    ptItem->button_press_event.connect(bind(slot(this,&TSceneTree::manageButtonPress), (TProcedural*) ptCamera));

    ptItem = new Gtk::TreeItem ("Camera");
    ptItem->show();

    ptTREE->append (*ptItem);
    ptItem->set_subtree (*ptSubtree);

    return true;
  }
  
  return false;

}  /* setCamera() */
Example #5
0
// ----------------------------------------------------------------------
// CRainfall::UpdateEngine
// Implementation of CParticleEngine::RenderEngine(TCamera &)
// ----------------------------------------------------------------------
//
void CRainfall::RenderEngine( TCamera & aCamera )
	{
    glDisable( GL_TEXTURE_2D );
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glColor4f( 1.0f, 1.0f, 1.0f, 0.5f );

	TVector CameraPos = aCamera.GetPosition();

	glVertexPointer( 3, GL_BYTE, 0, rainVertices );
    for ( GLint i = 0; i < iParticlesCount; i++ )
		{
		glLoadIdentity();
		glTranslatef( iParticles[i].iPosition.iX - CameraPos.iX,
			          iParticles[i].iPosition.iY - CameraPos.iY,
					  iParticles[i].iPosition.iZ - CameraPos.iZ );

		glDrawArrays( GL_LINES, 0, 2 );
		}

    glEnable( GL_TEXTURE_2D );
    glDisable(GL_BLEND);
	}
Example #6
0
Preferences::Preferences()
	: m_units("mm"), m_cameraUnits("inch"), m_scanLevelType("tif"), m_defLevelWidth(0.0), m_defLevelHeight(0.0), m_defLevelDpi(0.0), m_iconSize(160, 120), m_blankColor(TPixel32::White), m_frontOnionColor(TPixel::Black), m_backOnionColor(TPixel::Black), m_transpCheckBg(TPixel::White), m_transpCheckInk(TPixel::Black), m_transpCheckPaint(TPixel(127, 127, 127)), m_autosavePeriod(15), m_chunkSize(10), m_rasterOptimizedMemory(0), m_shrink(1), m_step(1), m_blanksCount(0), m_keyframeType(3), m_animationStep(1), m_textureSize(0), m_xsheetStep(10), m_shmmax(-1), m_shmseg(-1), m_shmall(-1), m_shmmni(-1), m_onionPaperThickness(50), m_currentLanguage(0), m_currentStyleSheet(0), m_undoMemorySize(100), m_dragCellsBehaviour(0), m_lineTestFpsCapture(25), m_defLevelType(0), m_autocreationType(1), m_autoExposeEnabled(true), m_autoCreateEnabled(true), m_subsceneFolderEnabled(true), m_generatedMovieViewEnabled(true), m_xsheetAutopanEnabled(true), m_ignoreAlphaonColumn1Enabled(false), m_rewindAfterPlaybackEnabled(true), m_fitToFlipbookEnabled(false), m_previewAlwaysOpenNewFlipEnabled(false), m_autosaveEnabled(false), m_defaultViewerEnabled(false), m_saveUnpaintedInCleanup(true), m_askForOverrideRender(true), m_automaticSVNFolderRefreshEnabled(true), m_SVNEnabled(false), m_minimizeSaveboxAfterEditing(true), m_levelsBackupEnabled(false), m_sceneNumberingEnabled(false), m_animationSheetEnabled(false), m_inksOnly(false), m_fillOnlySavebox(false), m_show0ThickLines(true), m_regionAntialias(false), m_viewerBGColor(128, 128, 128, 255), m_previewBGColor(64, 64, 64, 255), m_chessboardColor1(180, 180, 180), m_chessboardColor2(230, 230, 230), m_showRasterImagesDarkenBlendedInViewer(false), m_actualPixelViewOnSceneEditingMode(false), m_viewerZoomCenter(0), m_initialLoadTlvCachingBehavior(0), m_removeSceneNumberFromLoadedLevelName(false), m_replaceAfterSaveLevelAs(true), m_showFrameNumberWithLetters(false), m_levelNameOnEachMarker(false), m_columnIconLoadingPolicy((int)LoadAtOnce), m_moveCurrentFrameByClickCellArea(true), m_onionSkinEnabled(false), m_multiLayerStylePickerEnabled(false), m_paletteTypeOnLoadRasterImageAsColorModel(0), m_showKeyframesOnXsheetCellArea(true)
{
	TCamera camera;
	m_defLevelType = PLI_XSHLEVEL;
	m_defLevelWidth = camera.getSize().lx;
	m_defLevelHeight = camera.getSize().ly;
	m_defLevelDpi = camera.getDpi().x;

	TFilePath layoutDir = ToonzFolder::getMyModuleDir();
	TFilePath savePath = layoutDir + TFilePath("preferences.ini");

	m_settings.reset(new QSettings(QString::fromStdWString(savePath.getWideString()),
								   QSettings::IniFormat));

	getValue(*m_settings, "autoExposeEnabled", m_autoExposeEnabled);
	getValue(*m_settings, "autoCreateEnabled", m_autoCreateEnabled);
	getValue(*m_settings, "subsceneFolderEnabled", m_subsceneFolderEnabled);
	getValue(*m_settings, "generatedMovieViewEnabled", m_generatedMovieViewEnabled);
	getValue(*m_settings, "xsheetAutopanEnabled", m_xsheetAutopanEnabled);
	getValue(*m_settings, "ignoreAlphaonColumn1Enabled", m_ignoreAlphaonColumn1Enabled);
	getValue(*m_settings, "rewindAfterPlayback", m_rewindAfterPlaybackEnabled);
	getValue(*m_settings, "previewAlwaysOpenNewFlip", m_previewAlwaysOpenNewFlipEnabled);
	getValue(*m_settings, "fitToFlipbook", m_fitToFlipbookEnabled);
	getValue(*m_settings, "automaticSVNFolderRefreshEnabled", m_automaticSVNFolderRefreshEnabled);
	getValue(*m_settings, "SVNEnabled", m_SVNEnabled);
	getValue(*m_settings, "minimizeSaveboxAfterEditing", m_minimizeSaveboxAfterEditing);
	getValue(*m_settings, "levelsBackupEnabled", m_levelsBackupEnabled);
	getValue(*m_settings, "sceneNumberingEnabled", m_sceneNumberingEnabled);
	getValue(*m_settings, "animationSheetEnabled", m_animationSheetEnabled);
	getValue(*m_settings, "autosaveEnabled", m_autosaveEnabled);
	getValue(*m_settings, "defaultViewerEnabled", m_defaultViewerEnabled);
	getValue(*m_settings, "rasterOptimizedMemory", m_rasterOptimizedMemory);
	getValue(*m_settings, "saveUnpaintedInCleanup", m_saveUnpaintedInCleanup);
	getValue(*m_settings, "autosavePeriod", m_autosavePeriod);
	getValue(*m_settings, "taskchunksize", m_chunkSize);
	getValue(*m_settings, "xsheetStep", m_xsheetStep);

	int r = 0, g = 0, b = 0;
	getValue(*m_settings, "frontOnionColor.r", r);
	getValue(*m_settings, "frontOnionColor.g", g);
	getValue(*m_settings, "frontOnionColor.b", b);
	m_frontOnionColor = TPixel32(r, g, b);

	getValue(*m_settings, "onionPaperThickness", m_onionPaperThickness);

	r = 0, g = 0, b = 0;
	getValue(*m_settings, "backOnionColor.r", r);
	getValue(*m_settings, "backOnionColor.g", g);
	getValue(*m_settings, "backOnionColor.b", b);
	m_backOnionColor = TPixel32(r, g, b);

	r = m_transpCheckBg.r, g = m_transpCheckBg.g, b = m_transpCheckBg.b;
	getValue(*m_settings, "transpCheckInkOnBlack.r", r);
	getValue(*m_settings, "transpCheckInkOnBlack.g", g);
	getValue(*m_settings, "transpCheckInkOnBlack.b", b);
	m_transpCheckBg = TPixel32(r, g, b);

	r = m_transpCheckInk.r, g = m_transpCheckInk.g, b = m_transpCheckInk.b;
	getValue(*m_settings, "transpCheckInkOnWhite.r", r);
	getValue(*m_settings, "transpCheckInkOnWhite.g", g);
	getValue(*m_settings, "transpCheckInkOnWhite.b", b);
	m_transpCheckInk = TPixel32(r, g, b);
	r = m_transpCheckPaint.r, g = m_transpCheckPaint.g, b = m_transpCheckPaint.b;
	getValue(*m_settings, "transpCheckPaint.r", r);
	getValue(*m_settings, "transpCheckPaint.g", g);
	getValue(*m_settings, "transpCheckPaint.b", b);
	m_transpCheckPaint = TPixel32(r, g, b);

	getValue(*m_settings, "onionInksOnly", m_inksOnly);
	getValue(*m_settings, "iconSizeX", m_iconSize.lx);
	getValue(*m_settings, "iconSizeY", m_iconSize.ly);
	getValue(*m_settings, s_show0ThickLines, m_show0ThickLines);
	getValue(*m_settings, s_regionAntialias, m_regionAntialias);
	getValue(*m_settings, "viewShrink", m_shrink);
	getValue(*m_settings, "viewStep", m_step);
	getValue(*m_settings, "blanksCount", m_blanksCount);
	getValue(*m_settings, "askForOverrideRender", m_askForOverrideRender);
	r = 255, g = 255, b = 255;
	getValue(*m_settings, "blankColor.r", r);
	getValue(*m_settings, "blankColor.g", g);
	getValue(*m_settings, "blankColor.b", b);
	getValue(*m_settings, "undoMemorySize", m_undoMemorySize);
	setUndoMemorySize(m_undoMemorySize);
	m_blankColor = TPixel32(r, g, b);

	QString units;
	units = m_settings->value("linearUnits").toString();
	if (units != "")
		m_units = units;
	setUnits(m_units.toStdString());

	units = m_settings->value("cameraUnits").toString();
	if (units != "")
		m_cameraUnits = units;
	setCameraUnits(m_cameraUnits.toStdString());

	getValue(*m_settings, "keyframeType", m_keyframeType);

	getValue(*m_settings, "animationStep", m_animationStep);

	getValue(*m_settings, "textureSize", m_textureSize);
	QString scanLevelType;
	scanLevelType = m_settings->value("scanLevelType").toString();
	if (scanLevelType != "")
		m_scanLevelType = scanLevelType;
	setScanLevelType(m_scanLevelType.toStdString());

	getValue(*m_settings, "shmmax", m_shmmax);
	getValue(*m_settings, "shmseg", m_shmseg);
	getValue(*m_settings, "shmall", m_shmall);
	getValue(*m_settings, "shmmni", m_shmmni);

	// Load level formats
	getDefaultLevelFormats(m_levelFormats);
	getValue(*m_settings, m_levelFormats);
	std::sort(m_levelFormats.begin(), m_levelFormats.end(), // Format sorting must be
			  formatLess);									// enforced

	TFilePath lang_path = TEnv::getConfigDir() + "loc";
	TFilePathSet lang_fpset;
	m_languageMaps[0] = "english";
	//m_currentLanguage=0;
	try {
		TFileStatus langPathFs(lang_path);

		if (langPathFs.doesExist() && langPathFs.isDirectory()) {
			TSystem::readDirectory(lang_fpset, lang_path, true, false);
		} else {
		}
		TFilePathSet::iterator it = lang_fpset.begin();

		int i = 1;
		for (it; it != lang_fpset.end(); it++, i++) {
			TFilePath newPath = *it;
			if (newPath == lang_path)
				continue;
			if (TFileStatus(newPath).isDirectory()) {
				QString string = QString::fromStdWString(newPath.getWideName());
				m_languageMaps[i] = string;
			}
		}
	} catch (...) {
	}

	TFilePath path(TEnv::getConfigDir() + "qss");
	TFilePathSet fpset;
	try {
		TSystem::readDirectory(fpset, path, true, false);
		TFilePathSet::iterator it = fpset.begin();
		int i = 0;
		for (it; it != fpset.end(); it++, i++) {
			TFilePath newPath = *it;
			if (newPath == path)
				continue;
			QString fpName = QString::fromStdWString(newPath.getWideName());
#ifdef MACOSX
			QString string = fpName + QString("/") + fpName + QString("_mac.qss");
#else
			QString string = fpName + QString("/") + fpName + QString(".qss");
#endif
			if (fpName == QString("standard"))
				m_currentStyleSheet = i;
			m_styleSheetMaps[i] = "file:///" + path.getQString() + "/" + string;
		}
	} catch (...) {
	}

	getValue(*m_settings, "CurrentLanguage", m_currentLanguage);
	getValue(*m_settings, "CurrentStyleSheet", m_currentStyleSheet);
	getValue(*m_settings, "DragCellsBehaviour", m_dragCellsBehaviour);

	getValue(*m_settings, "LineTestFpsCapture", m_lineTestFpsCapture);
	getValue(*m_settings, "FillOnlysavebox", m_fillOnlySavebox);
	getValue(*m_settings, "AutocreationType", m_autocreationType);
	getValue(*m_settings, "DefLevelType", m_defLevelType);
	getValue(*m_settings, "DefLevelWidth", m_defLevelWidth);
	getValue(*m_settings, "DefLevelHeight", m_defLevelHeight);
	getValue(*m_settings, "DefLevelDpi", m_defLevelDpi);

	getValue(*m_settings, "viewerBGColor", m_viewerBGColor);
	getValue(*m_settings, "previewBGColor", m_previewBGColor);
	getValue(*m_settings, "chessboardColor1", m_chessboardColor1);
	getValue(*m_settings, "chessboardColor2", m_chessboardColor2);
	getValue(*m_settings, "showRasterImagesDarkenBlendedInViewer", m_showRasterImagesDarkenBlendedInViewer);
	getValue(*m_settings, "actualPixelViewOnSceneEditingMode", m_actualPixelViewOnSceneEditingMode);
	getValue(*m_settings, "viewerZoomCenter", m_viewerZoomCenter);
	getValue(*m_settings, "initialLoadTlvCachingBehavior", m_initialLoadTlvCachingBehavior);
	getValue(*m_settings, "removeSceneNumberFromLoadedLevelName", m_removeSceneNumberFromLoadedLevelName);
	getValue(*m_settings, "replaceAfterSaveLevelAs", m_replaceAfterSaveLevelAs);
	getValue(*m_settings, "showFrameNumberWithLetters", m_showFrameNumberWithLetters);
	getValue(*m_settings, "levelNameOnEachMarkerEnabled", m_levelNameOnEachMarker);
	getValue(*m_settings, "columnIconLoadingPolicy", m_columnIconLoadingPolicy);
	getValue(*m_settings, "moveCurrentFrameByClickCellArea", m_moveCurrentFrameByClickCellArea);
	getValue(*m_settings, "onionSkinEnabled", m_onionSkinEnabled);
	getValue(*m_settings, "multiLayerStylePickerEnabled", m_multiLayerStylePickerEnabled);
	getValue(*m_settings, "paletteTypeOnLoadRasterImageAsColorModel", m_paletteTypeOnLoadRasterImageAsColorModel);
	getValue(*m_settings, "showKeyframesOnXsheetCellArea", m_showKeyframesOnXsheetCellArea);
}
Q_INVOKABLE QScriptValue Rasterizer::rasterize(QScriptValue arg) {
  Image *img        = qscriptvalue_cast<Image *>(arg);
  Level *level      = qscriptvalue_cast<Level *>(arg);
  TPalette *palette = 0;
  if (img) {
    if (img->getType() != "Vector")
      return context()->throwError(
          tr("Expected a vector image: %1").arg(arg.toString()));
    palette = !!img->getImg() ? img->getImg()->getPalette() : 0;
  } else if (level) {
    if (level->getType() != "Vector")
      return context()->throwError(
          tr("Expected a vector level: %1").arg(arg.toString()));
    palette =
        level->getSimpleLevel() ? level->getSimpleLevel()->getPalette() : 0;
  } else {
    return context()->throwError(
        tr("Argument must be a vector level or image : ").arg(arg.toString()));
  }
  if (!palette) {
    return context()->throwError(tr("%1 has no palette").arg(arg.toString()));
  }

  TDimension res(m_xres, m_yres);
  TCamera camera;
  camera.setRes(res);
  camera.setSize(TDimensionD(m_xres / m_dpi, m_yres / m_dpi));
  TPointD dpi = camera.getDpi();
  TAffine aff = camera.getStageToCameraRef();

  QScriptValue result;
  int n               = 0;
  TXshSimpleLevel *sl = 0;
  if (level) {
    result = create(engine(), new Level());
    n      = level->getFrameCount();
    sl     = level->getSimpleLevel();
  }

  if (m_colorMapped) {
    // vector -> toonz image
    if (img) {
      TImageP outImg = vectorToToonzRaster(img->getImg(), res, aff, dpi);
      result         = create(engine(), new Image(outImg));
    } else {
      for (int i = 0; i < n; i++) {
        TFrameId fid    = sl->index2fid(i);
        TImageP drawing = sl->getFrame(fid, false);
        TImageP outImg  = vectorToToonzRaster(drawing, res, aff, dpi);
        setFrame(engine(), result, fid, outImg);
      }
    }
  } else {
    // vector -> full color
    TPixel32 bgColor = TPixel32::White;

    TOfflineGL *glContext = new TOfflineGL(res);
    glContext->makeCurrent();

    TVectorRenderData rd(TVectorRenderData::ProductionSettings(), aff, TRect(),
                         palette);
    rd.m_antiAliasing = m_antialiasing;

    if (img) {
      TImageP outImg =
          renderVectorImage(glContext, rd, dpi, img->getImg(), bgColor);
      result = create(engine(), new Image(outImg));
    } else {
      for (int i = 0; i < n; i++) {
        TFrameId fid    = sl->index2fid(i);
        TImageP drawing = sl->getFrame(fid, false);
        glContext->clear(TPixel32::White);
        TImageP outImg =
            renderVectorImage(glContext, rd, dpi, drawing, bgColor);
        setFrame(engine(), result, fid, outImg);
      }
    }
    delete glContext;
  }

  return result;
}
Example #8
0
void Update()
{
    //Effacer le sprite et texture de la mémoire
    if (g_pSprite != nullptr)
    {
        GfxSpriteDestroy(g_pSprite);
        g_pSprite = nullptr; // Libert l'adresse mémoire du sprite
    }

    if (g_pTexture != nullptr)
    {
        GfxTextureDestroy(g_pTexture);
        g_pTexture = nullptr;
    }

    TCamera tCamera;
    TSphere tSphere[MAX_SPHERES];
    TPlan tPlan;
    tPlan.m_tPosition = TGfxVec3(0, -5, 0);
    tSphere[0].m_tPosition = TGfxVec3(-1, 0, 8);
    tSphere[0].m_tColor = TGfxVec3(255, 0, 0);
    tSphere[1].m_tPosition = TGfxVec3(-3, 0, 8);
    tSphere[1].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[2].m_tPosition = TGfxVec3(1, 0, 8);
    tSphere[2].m_tColor = TGfxVec3(0, 0, 255);
    tSphere[3].m_tPosition = TGfxVec3(3, 0, 8);
    tSphere[3].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[4].m_tPosition = TGfxVec3(0, 1, 8);
    tSphere[4].m_tColor = TGfxVec3(255, 0, 0);
    tSphere[5].m_tPosition = TGfxVec3(0, -1, 8);
    tSphere[5].m_tColor = TGfxVec3(0, 0, 255);
    tSphere[6].m_tPosition = TGfxVec3(0, -3, 8);
    tSphere[6].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[7].m_tPosition = TGfxVec3(0, 3, 8);
    tSphere[7].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[8].m_tPosition = TGfxVec3(-2, -2, 8);
    tSphere[8].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[9].m_tPosition = TGfxVec3(-2, 2, 8);
    tSphere[9].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[10].m_tPosition = TGfxVec3(2, 2, 8);
    tSphere[10].m_tColor = TGfxVec3(255, 255, 0);
    tSphere[11].m_tPosition = TGfxVec3(2, -2, 8);
    tSphere[11].m_tColor = TGfxVec3(255, 255, 0);
    tCamera.m_tPosition = TGfxVec3(g_fx, g_fy, g_fz);
    tCamera.m_fFOV = 120.f;
    tCamera.Render(g_pImage, tSphere, tPlan);

    g_pTexture = GfxTextureCreate(g_pImage);
    g_pSprite = GfxSpriteCreate(g_pTexture);
    GfxSpriteSetScale(g_pSprite, float(SCALE_FACTOR), float(SCALE_FACTOR));
    GfxSpriteSetFilteringEnabled(g_pSprite, false);



    if (GfxInputIsPressed(EGfxInputID_KeyArrowUp))
    {
        g_fy += 0.1f;
    }

    if (GfxInputIsPressed(EGfxInputID_KeyArrowDown))
    {
        g_fy -= 0.1f;
    }

    if (GfxInputIsPressed(EGfxInputID_KeyArrowRight))
    {
        g_fx += 0.1f;
    }

    if (GfxInputIsPressed(EGfxInputID_KeyArrowLeft))
    {
        g_fx -= 0.1f;
    }

    if (GfxInputIsPressed(EGfxInputID_KeyCharS))
    {
        g_fz -= 0.1f;
    }

    if (GfxInputIsPressed(EGfxInputID_KeyCharZ))
    {
        g_fz += 0.1f;
    }
}