The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C# Code
Posted by: spunge | December 16, 2010 @ 8:56pm
C# Code
[
Download
]
public override void Update(GameTime gameTime) { //cameraPosition = Vector3.Transform(cameraPosition, Matrix.CreateRotationY(0.01f)) + target; // Move forward/backward if (Keyboard.GetState().IsKeyDown(Keys.A)) cameraPosition = Vector3.Transform(cameraPosition, Matrix.CreateRotationY(-0.01f)) ; if (Keyboard.GetState().IsKeyDown(Keys.D)) cameraPosition = Vector3.Transform(cameraPosition, Matrix.CreateRotationY(0.01f)) ; if (Keyboard.GetState().IsKeyDown(Keys.W)) cameraPosition = Vector3.Transform(cameraPosition, Matrix.CreateRotationX(-0.01f)) ; if (Keyboard.GetState().IsKeyDown(Keys.S)) cameraPosition = Vector3.Transform(cameraPosition, Matrix.CreateRotationX(0.01f)) ; // if(Keyboard.GetState().IsKeyDown(Keys.F)); // cameraPosition = Matrix.CreateTranslation(-20.0f / 3.0f, -10.0f / 3.0f, 0) * Matrix.CreateFromAxisAngle(rotAxis, 0.01f); CreateLookAt(); base.Update(gameTime); } private void CreateLookAt() { view = Matrix.CreateLookAt(cameraPosition, target, Vector3.Up); }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.51 / 8
63 Votes
http://codebin.yi.org/1015
page generated in 0.01 seconds