Jump to content

Coding viewer camera


HotFriend
 Share

You are about to reply to a thread that has been inactive for 3212 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Im making a Second Life Viewer for Windows Store. I have made a code for the camera

 

// Initializes view parameters when the window size changes.
void ViewerPage::CreateWindowSizeDependentResources()
{
	Size outputSize = m_deviceResources->GetOutputSize();
	float aspectRatio = outputSize.Width / outputSize.Height;
	float fovAngleY = 70.0f * XM_PI / 180.0f;

	// This is a simple example of change that can be made when the app is in
	// portrait or snapped view.
	if (aspectRatio < 1.0f)
	{
		fovAngleY *= 2.0f;
	}

	// Note that the OrientationTransform3D matrix is post-multiplied here


	Scale = XMMatrixScaling(0.25f, 0.25f, 0.25f);
	Translation = XMMatrixTranslation(0.0f, 0.0f, 0.0f);
	playerCharWorld = Scale * Translation;

	//Camera information
	LLCamera.position = XMVectorSet(0.0f, 10.0f, 8.0f, 0.0f);
	LLCamera.target = XMVectorSet(0.0f, 3.0f, 0.0f, 0.0f);
	LLCamera.up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);

	XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(XMMatrixLookAtRH(eye, at, up)));
}

 

 

Is there any way to set the cameras position?

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3212 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...