Jump to content
  • Advertisement

kaisellgren

Member
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

122 Neutral

About kaisellgren

  • Rank
    Member
  1. kaisellgren

    So how do I setup a camera in 3D?

    Oh, I changed some camera *position* values and this is what I saw! http://img216.imageshack.us/img216/6992/tanku.png Don't laugh! My tank looks horrible, wtf?
  2. Hi, I have a beautiful model rendered on my screen now, but at wrong angle and position. I am creating a 3D real-time strategy game so what I need is a top-down camera with a slight angle. foreach (ModelMesh mesh in myModel.Meshes) { // This is where the mesh orientation is set, as well as our camera and projection. foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.AmbientLightColor = new Vector3(0.0f, 0.0f, 0.0f); effect.View = Matrix.CreateLookAt(new Vector3(0,0,0), new Vector3(0, 0, 0), new Vector3(0, 1, 0)); effect.World = Matrix.CreateTranslation(0, 0, 0); effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), 1680f / 1050f, 0.1f, 100f); } // Draw the mesh, using the effects set above. mesh.Draw(); } How would I make my model to appear like in strategy games in that code? I have tried millions of different number combinations and mostly I see nothing rendered or the camera is inside the model or something weird... If I can just get a typical like strategy game view then I can work my way from there.. Basically, a top-down view into my model, but slight angle so that the 3D'ish becomes more seeable. :) Can someone help me out? And ah, is there a link to any tutorials explaining what all those view, project, world are exactly supposed to do? Perhaps a tutorail with pictures?
  3. kaisellgren

    XNA 3 and loading GIF files?

    http://xnagif.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14762 :)
  4. kaisellgren

    XNA 3 and loading GIF files?

    Yes I need an animated image. That's not possible in XNA :O? Can you show me path to animated sprite sheet things or something? At least give me a link to MSDN or so for clues.. What does that gman statement has to do with this?
  5. Hi, I am trying to load a GIF file with XNA 3 and C#, but I am receiving this error: Cannot autodetect which importer to use for "file.gif". So it looks that XNA doesn't directly support GIF (odd) and that I need to somehow make it on my own. Does someone have a solution for this?
  6. Unfortunately I am using C# and XNA... does this still work for me?
  7. Hi, How on earth would I draw lines ? Or what about filled (and or nonfilled) rectangles with opacity? I can't seem to find any clues on how to do it.
  8. kaisellgren

    Random Number

    None of these are random number generators... just pseudorandom sequence generators. Have a look at assembly System.Security.Cryptography at a class called something like Random Number Generator Provider or so. This, of course, if you want *Random* numbers.
  9. kaisellgren

    Inheriting partial methods?

    Thanks! I wonder why I do not see code tag controls in this writing form?
  10. Hi, I have a small problem. I have a base class A and I have a class B which both have the same methods. The thing is, I want the method in A to be run, but I want the same method for B to be run after A to "complete" it. class A { public void do() {...} } class A : B { public void do() {... /* even more */ ...} }
  11. kaisellgren

    Matrix.RotationZ will mess up my sprite?

    Oh! It works now, thanks! :)
  12. kaisellgren

    Matrix.RotationZ will mess up my sprite?

    Something is wrong, I do not see it drawing anything (draws probably outside the screen). GameEngine.Infantries.Sprite.Transform = Matrix.Transformation2D(new Vector2(0,0),0,Vector2.Empty,new Vector2(64,64), GameEngine.Infantries.Rotation,new Vector2(GameEngine.Infantries.X+GameEngine.ViewX,GameEngine.Infantries.Y+GameEngine.ViewY)); GameEngine.Infantries.Sprite.Draw(GameEngine.Infantries.Texture, new Vector3(64, 64, 0), new Vector3(0, 0, 0), Color.White.ToArgb()); I also tried passing the position to the Draw(): GameEngine.Infantries.Sprite.Draw(GameEngine.Infantries.Texture, new Vector3(64, 64, 0), new Vector3(GameEngine.Infantries.X + GameEngine.ViewX, GameEngine.Infantries.Y + GameEngine.ViewY, 0), Color.White.ToArgb()); Neither showed me anything. Did I do something wrong?
  13. kaisellgren

    Matrix.RotationZ will mess up my sprite?

    Quote:Original post by MJP Is this MDX? I've never used it, but I'm guess that it behaves like the old D3D9 sprite class where the transform is applied AFTER the vertices are transformed by the translation you supply to Draw. You'll want to set Transform to a Matrix that is the result of Rotatation * Translation. Yes this is C# and MDX. Hmm that sounds interesting. Can you elaborate this: You'll want to set Transform to a Matrix that is the result of Rotatation * Translation. So I should apply translation to that rotation?
  14. Hi, I have a sprite which works fine as long as I do not rotate it. Basically, the location of the drawn sprite will change based on the rotation somehow... Please look at my code: GameEngine.Infantries.Sprite.Begin(SpriteFlags.AlphaBlend); GameEngine.Infantries.Sprite.Transform = Matrix.RotationYawPitchRoll(0,0,GameEngine.Infantries.Rotation); GameEngine.Infantries.Sprite.Draw(GameEngine.Infantries.Texture, new Vector3(64, 64, 0), new Vector3(GameEngine.Infantries.X + GameEngine.ViewX, GameEngine.Infantries.Y + GameEngine.ViewY, 0), Color.White.ToArgb()); GameEngine.Infantries.Sprite.End(); This code just does not work if I apply that rotation. The location of the sprite becomes wrong... why? The .X and .Y is the sprite location and ViewX and ViewY is obviously the "screen view port" location... it works fine until I rotate.. what am I doing wrong? The sprite has a size of 128x128 so the center rotation point should be 64,64,0... it's a 2D game.
  15. Hi, I have a bunch of textures (TGA files of 256x256 size) and I would like to make a ground texture based on those. My game is 2D. I have applied a base texture, but now I would like to apply some of those textures into the base texture. I want to blend smoothly somehow, but I have no idea how. Just placing a 256x256 textures randomly on the ground is ridiculous and the borders of textures are recognizable.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!