//------------------------------
	bool SceneGraphCreator::create()
	{
		if ( !mVisualScene )
			return false;

		INode* rootNode = getMaxInterface()->GetRootNode();

//why does this not work: setting rotation on root node
// 		Matrix3 maxTransformationMatrix;
// 		Matrix4ToMaxMatrix3(maxTransformationMatrix, mUpAxisRotation);
// 		rootNode->SetNodeTM(0, maxTransformationMatrix);
// 
// 		Matrix3 x = rootNode->GetNodeTM(0);

		if( COLLADABU::Math::Matrix4::IDENTITY != mUpAxisRotation )
		{
			ImpNode* upAxisCorrectionNode = getMaxImportInterface()->CreateNode();
			Matrix3 maxTransformationMatrix;
			Matrix4ToMaxMatrix3( maxTransformationMatrix, mUpAxisRotation );
			upAxisCorrectionNode->SetName(__T("upaxis"));
			upAxisCorrectionNode->SetTransform(0, maxTransformationMatrix);
			INode* iNode = upAxisCorrectionNode->GetINode();
			upAxisCorrectionNode->Reference( getDummyObject() );
			rootNode->AttachChild(iNode, FALSE);
			importNodes(mVisualScene->getRootNodes(), iNode);
		}
		else
			importNodes(mVisualScene->getRootNodes(), rootNode);

		return true;
	}
	//------------------------------
	GenCamera* CameraImporter::createCamera( const COLLADAFW::Camera* camera )
	{
		// TODO TARGETED_CAMERA 
		GenCamera* maxCamera = getMaxImportInterface()->CreateCameraObject( FREE_CAMERA );

		float targetDistance = 100; // we don't have a target, therefore we need to set anything
		maxCamera->SetTDist(0, targetDistance);

		if (camera->getCameraType() == COLLADAFW::Camera::PERSPECTIVE)
		{
			// Perspective camera
			maxCamera->SetOrtho(FALSE);
			switch ( camera->getDescriptionType() )
			{
			case COLLADAFW::Camera::SINGLE_X:
			case COLLADAFW::Camera::X_AND_Y:
			case COLLADAFW::Camera::ASPECTRATIO_AND_X:
				maxCamera->SetFOVType(0);
				maxCamera->SetFOV(0, COLLADABU::Math::Utils::degToRadF( (float)camera->getXFov()));
				break;
			case COLLADAFW::Camera::SINGLE_Y:
			case COLLADAFW::Camera::ASPECTRATIO_AND_Y:
				{
					float aspectRatio = getMaxInterface()->GetRendImageAspect();
					maxCamera->SetFOVType(1);
					float yfov = COLLADABU::Math::Utils::degToRadF( (float)camera->getYFov());
					float xfov = 2 * atan( aspectRatio * tan(yfov/2));
					maxCamera->SetFOV(0, xfov);
					break;
				}
			}
		}
		else
		{
			// Orthographic camera
			maxCamera->SetOrtho(TRUE);

			// Consider only the correct magnification and the target distance,
			// which is kept constant, to calculate the FOV.
			switch ( camera->getDescriptionType() )
			{
			case COLLADAFW::Camera::SINGLE_X:
			case COLLADAFW::Camera::X_AND_Y:
			case COLLADAFW::Camera::ASPECTRATIO_AND_X:
				{
					maxCamera->SetFOVType(0);
					float fov = 2 * (float)atan( camera->getXMag()/targetDistance );
					maxCamera->SetFOV(0, fov);
					break;
				}
			case COLLADAFW::Camera::SINGLE_Y:
			case COLLADAFW::Camera::ASPECTRATIO_AND_Y:
				{
					float aspectRatio = getMaxInterface()->GetRendImageAspect();
					maxCamera->SetFOVType(1);
					float yfov = 2 * (float)atan( camera->getYMag()/targetDistance );
					float xfov = 2 * atan( aspectRatio * tan(yfov/2));
					maxCamera->SetFOV(0, xfov );
					break;
				}
			}
		}

		// Common camera parameters: nearZ, farZ
		// The "Far Clip " animatable parameter intentionally has an extra space in the definition.
		maxCamera->SetClipDist(0, CAM_HITHER_CLIP, (float)camera->getNearClippingPlane());
		maxCamera->SetClipDist(0, CAM_YON_CLIP, (float)camera->getFarClippingPlane());
		maxCamera->SetManualClip(TRUE);
		maxCamera->Enable(TRUE);
		
		return maxCamera;
	}