- sln.zip
- sln
- DataRace
- Debugging1
- Debugging2
- Parallel
- ParallelDLS.sln
- ParallelExtensionsExtras
- PLINQ
- PLINQExtensions
- Raytracer_CSharp
- Tasks
- Temp
|
//--------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: Camera.cs
//
//--------------------------------------------------------------------------
namespace Microsoft.ParallelComputingPlatform.ParallelExtensions.Samples
{
class Camera
{
public Vector Pos;
public Vector Forward;
public Vector Up;
public Vector Right;
public Camera(Vector pos, Vector forward, Vector up, Vector right) { Pos = pos; Forward = forward; Up = up; Right = right; }
public static Camera Create(Vector pos, Vector lookAt)
{
Vector forward = Vector.Norm(Vector.Minus(lookAt, pos));
Vector down = new Vector(0, -1, 0);
Vector right = Vector.Times(1.5, Vector.Norm(Vector.Cross(forward, down)));
Vector up = Vector.Times(1.5, Vector.Norm(Vector.Cross(forward, right)));
return new Camera(pos, forward, up, right);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.