Page 1 of 1

RF2 Camera Design

Posted: Wed Jan 06, 2010 6:48 pm
by paradoxnj
I want to involve the community in the designing of RF2. I'd like to know your requirements to make your game so that I can make RF2 as generic as possible. This will allow RF2 to be used for anything from a first person shooter to a point and click strategy game to a story driven RPG.

In this post, I would like your requirements for the camera. I will list out what I have so far and you tell me what you require by replying to this post.
Camera Design
-- Shell should be allowed to create multiple cameras and switch between them in the game (e.g. Security Camera)

-- Camera should be attached to the Ogre Compositor framework to allow post-screen shaders (e.g Bloom, Blur)

-- Camera should be able to be attached to other objects so that it follows. A camera not attached to an object is a free-look camera

-- Camera should expose properties to script which allow the users to create their own camera styles and modify the camera in the game. Properties that should be exposed are:
* Offset (Vector3) - Offset of the camera position to the attached object
* Drag (float) - Value for dragging the camera when a player starts moving
* FOV (float) - Field of view in radians

-- Camera should be able to turn collision on and off when needed

-- Camera should be attached to the physics system for realistic movement and reaction.

Re: RF2 Camera Design

Posted: Wed Jan 06, 2010 7:14 pm
by QuestOfDreams
I think you got the essential properties right there. Maybe the type of projection (orthographic / perspective) and field of view would be nice to configure per camera, though these might just be specified when creating a camera...
Is the drag value just related to translations or also rotations?

Re: RF2 Camera Design

Posted: Wed Jan 06, 2010 11:54 pm
by Jay
It would also be nice to be able to change the rotation of the camera by script (I only see the position property in your list, would be a vector3). Other than that, i think you have all the essential properties.

Re: RF2 Camera Design

Posted: Thu Jan 07, 2010 8:21 pm
by paradoxnj
The following camera functions will be exposed to script:

Code: Select all

                __inline const char *getName()					{ return m_strName.c_str();	}
	__inline void setName(const char *lpszName)		{ m_strName = lpszName; }

	void setPosition(Ogre::Vector3 *pPos);
	Ogre::Vector3 *getPosition();

	void setOrientation(Ogre::Quaternion *pRot);
	Ogre::Quaternion *getOrientation();

	void yaw(float fYaw);
	void pitch(float fPitch);
	void roll(float fRoll);

	void attachObject(RFObject *pObj);
	RFObject *getAttachedObject();

	int getProjectionType();
	void setProjectionType(int t);

	int getPolygonMode();
	void setPolygonMode(int pm);

	void setDirection(Ogre::Vector3 *pDir);
	Ogre::Vector3 *getDirection();

	void lookAt(Ogre::Vector3 *pTarget);

	void setFixedYawAxis(bool bUseFixed, Ogre::Vector3 *pFixedAxis = &Ogre::Vector3::UNIT_Y);
	void setFOV(float fFOV);

	void setNearClipDistance(float fDist);
	float getNearClipDistance();

	void setFarClipDistance(float fDist);
	float getFarClipDistance();

	void setAspectRatio(float fRatio);
	float getAspectRatio();

Re: RF2 Camera Design

Posted: Fri Jan 08, 2010 5:22 am
by zany_001
Only thing I can think of to add is being able to blend the output of two cameras, for 3D work. Keep up the good work!

Re: RF2 Camera Design

Posted: Fri Jan 08, 2010 10:35 am
by Juutis
Multiple windows on the screen. (Splitscreen)

Projecting the output of a camera to a texture. Like, you could have a security camera and you could see its view on a monitor in the game.

Re: RF2 Camera Design

Posted: Fri Jan 08, 2010 10:49 pm
by paradoxnj
@zany - Can you give me an example of what this would be used for?

@Juutis - Render to texture is an expected feature as is multiple on-screen camera views.

Re: RF2 Camera Design

Posted: Sat Jan 09, 2010 9:48 am
by zany_001
Stereoscopic games, like ubisoft's Avatar game is supposed to be like. It's certainly not a necessity, but would be a really cool feature.

Re: RF2 Camera Design

Posted: Mon Jan 11, 2010 6:25 pm
by paradoxnj
@zany - Stereoscopic gaming is a very new technology. This will not be available day one but is a good suggestion to incorporate into the shell eventually.