Skip to main content
GameDev.net gamedev.net
🔒 Locked

hello, prob in beginning 3d game programing

Started by a_metalhead Mar 16, 2005 at 12:00 AM 9 replies 2.7k views
Original Post
a_metalhead
a_metalhead
hey evryone... i bought the beginning 3d game progrmaing book (by Tom Miller) and the 'tankers' example throws an exeption when i try to load the tank mesh hirocy... (it will even crash on the code that ships on the cd) dose anyone know how to fix this? mabey a prob with the mesh? thanks, ~metalhead
kovacsp
kovacsp
hi,

is the file to be loaded there, where the prog looks for it?

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
a_metalhead
a_metalhead
yah there is... it loads the file, but then right when its loading the hirocy, it crashes

	public class tankAllocHi : AllocateHierarchy	{		public override Frame CreateFrame(string name)		{			tankFrame frame = new tankFrame();			frame.Name = name;			frame.TransformationMatrix = Matrix.Identity;			frame.CombinedTransformationMatrix = Matrix.Identity;			return frame;		}		public override MeshContainer CreateMeshContainer(string name, MeshData meshData, ExtendedMaterial[] materials, EffectInstance[] effectInstances, GraphicsStream adjacency, SkinInformation skinInfo)		{			tankMeshCont mesh = new tankMeshCont();			mesh.Name = name;			mesh.MeshData = meshData;			return mesh;		}	}	public class tankFrame : Frame	{		private Matrix combined = Matrix.Identity;		public Matrix CombinedTransformationMatrix		{			get{ return combined; }			set{ combined = value; }		}	}	public class tankMeshCont : MeshContainer	{	}


		public tank( Device pDevice )		{			device = pDevice;			AnimationRootFrame ar = Mesh.LoadHierarchyFromFile( gameEngine.mediaPath + TankMeshFile, 				MeshFlags.Managed , device , new tankAllocHi() , null ); // this is where it crashes			rootFrame = ar.FrameHierarchy as tankFrame;		}
a_metalhead
a_metalhead
it is acualy just a message box - but im sure its an exeption

here are the contents of the box:

ERROR IN THE APPLICATION,
-(E_FAIL)
at:
Mykre
Mykre
Just run the code and it works fine... But had to adjust the location of the media path in the appconfig file...

Make a copy of the complete media directory and move it to the main project directory. So you would then have the following

Tankers
- Source and solution files.
- Directory called framework
- Directory bin
- Directory obj
- Director Media

Then change the appconfig file media path in the solution app.config to
key="MediaPath" value="..\..\Media\Tankers\"
It should then run fine..

Posted what I did to get it to work here,
Forum Post
a_metalhead
a_metalhead
thanks a whole lot!! :D im at school right now, but i cant wait to get it to [finaly] run ;)
a_metalhead
a_metalhead
not working -_- i tryed it, and still no-go :(
a_metalhead
a_metalhead
can someone please help? you can download the source online too...
Mykre
Mykre
The Errors you explained above are becuase it can not find the files, I have got the code running and have posted the solution on my site if you are still having problems I can send you the code, but I would look at the file paths that are in the app.config file, you need to make sure that these point to the correct location.

http://www.ircomm.net/forums/33/ShowPost.aspx
a_metalhead
a_metalhead
but it can find the stuff - it displays the GUI, and on the tank selection screen it shows the tank properly there... ???

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.