PDA

View Full Version : Chrome : A tale of 4 Cameras



savage
27-05-2007, 01:16 AM
Well I had a rush of blood last night and finally finished a Chrome example that shows how to switch between a Fixed, Tracking, First Person and ThirdPerson Camera. It had been sitting on my HD for a few months now as I didn't know how to set up the 3D things
correctly. Then suddenly last night some things became clear.

http://www.pascalgamedevelopment.com/files/CamerasTutorial.png

The sample is based on the 3rd 3D Tutorial series and I originally thought it would make a good 4th Tutorial, but it seems the XNA team have something else planned for that.

I hope I'm not speaking too soon by saying, I think I may be starting to understand this 3D mumbo jumbo :).

Anyway here is a zip file (http://www.pascalgamedevelopment.com/files/CamerasTutorial.zip) that contains the Chrome code and executable.

Instructions
-------------
Toggle Camera Modes = Tab or Left Shoulder Button
Steer = Left & Right Arrow keys or Left Thumbstick
Accelerate = Up Arrow key or Right Trigger
Reset = A Button or Spacebar

All feedback welcome on how this could be improved as I have a lot to learn.

WILL
27-05-2007, 01:20 AM
Ooow cool! :)

btw, you've got mail. ;)

savage
27-05-2007, 01:29 AM
btw, you've got mail. ;)

Where????

WILL
27-05-2007, 05:17 AM
Look at your screenshot. :D

technomage
27-05-2007, 07:02 AM
Nice work Dom.

I just found out as well that you can use MSBuild to build the vs solution files even if you only have the command Line Chrome Compiler :D. You just can't open it in the IDE :(

NecroDOME
27-05-2007, 12:36 PM
@will... omg

savage
27-05-2007, 04:36 PM
I just found out as well that you can use MSBuild to build the vs solution files even if you only have the command Line Chrome Compiler :D. You just can't open it in the IDE :(

If you look at the batch file included in all the demos you'll see that they all use MSBuild to compile the demos, but I also include the VS solution in case you have the IDE plugin as well. The .chrome files are the equivalent of the .csproj files.

Setharian
27-05-2007, 04:45 PM
I get a crash after 10 seconds of nothing when I run the application and get some obsure error message saying "Application has generated an exception which could not be handled."....is there some hardware prerequisite for it to make it work?

savage
27-05-2007, 04:52 PM
Hmm interesting. Do you have XNA runtime (http://www.microsoft.com/downloads/details.aspx?FamilyID=a7da4763-6807-4bd5-8d18-18c60c437f93&displaylang=en) and .NET 2.0 (http://www.microsoft.com/downloads/details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en) or 3.0 (http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043&displaylang=en) installed?

Other than than you need to have Shader 1.2 or 2.0 to be able run the demos even though I am not using any shader stuff at all.

savage
11-06-2007, 09:51 AM
I've not had the time to look at adding the spring system to the cameras, but I just added 2 top-down camera views to the sample, in light of the recent Tutorial 4 ( Make a game in 60 minutes ). The 2 cameras are Top Down Fixed and Top Down Centered. Hopefully the names are self explanatory.

Btw, has anyone actually run any of the demos or tried to compile the code? The Chrome commandline compiler is free!

savage
29-06-2007, 11:10 AM
Just a quick update, I've finally added the spring system to this tutorial's 3rd person Camera. With the spring activated, when the ship speeds away, the camera pulls back. When the ship turns, the camera lags behind in the turn to show a partial profile view of the ship. When the ship stops moving, the camera gradually slides back into place.

By pressing the "A" button ( either GamePad or Keyboard ) to toggle the spring, you can compare and contrast the spring-based camera with a rigid, fixed-offset camera. You will notice that the spring-based camera provides a greater sense of speed.

This concludes this tutorial and all that is left to do is to create some XBox 360 projects to go along with this and the other XNA Chrome demos. Then I'll get started on the article.

savage
01-07-2007, 10:13 PM
I've just had confirmation from a guy here in the UK that the pure Chrome code ( absolutely no C# code what so ever ) version of this demo works on the XBox 360. He even SMSed me the picture of the icon/text you see on the XBox 360 console.
I'll get started on an article talking about the whole process.