Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Hover
Jun 14, 2003

Your post hits a tree.
The tree is an ent.
The tree is angry.
Has anyone had any experience with Dark GDK yet? (http://www.microsoft.com/express/samples/GameCreators/) I just found out about it a month or so ago while I was downloading the beta for VS2008. Apparently they struck some sort of deal with Microsoft and it's free to download with VS. I've been messing around with it to make something I can show off to employers since I'll be applying for jobs in the upcoming months, and it seems decent. I can't for the life of me find decent documentation on it other than it's help file, which is adequate I suppose. I've gone from getting completely lost using DirectX, to making a few things in OpenGL, to this, so it's definitely easier to get a grasp of.

Adbot
ADBOT LOVES YOU

Hover
Jun 14, 2003

Your post hits a tree.
The tree is an ent.
The tree is angry.

The Monarch posted:

Can someone send me a link that outlines (in a non coding language specific way) what I need to do for a first person camera? I'm just thinking about the best way to do it (I'm using XNA) but I'd like to see some other stuff and get some ideas.

Also, for anyone experienced with XNA, is there a link that explains the steps that XNA does take to render a model? I'm trying to figure out how to have my rendering in a seperate class, or at least be able to prepare the model (so my game.cs isn't filled with dozens of different model files and stuff), but all the tutorials I find are just "this is how you draw a model: copy this code in this method, this in that, and this code in the draw method and it works". I also have no idea what this does, and how I can break it apart:

*snip*

so I basically just copy and paste that for each model that I need to draw, which I know isn't right. I'm learning a lot with XNA but my programming experience is really low so a lot of this stuff is new to me.

Alright, I'm going to try to break the code apart for you. I've never used XNA specifically but I'm learning DirectX and have a fairly good understanding of the process of rendering something in 3D, so hopefully I can give you a good head start.

code:
foreach (ModelMesh mesh in terrainModel.Meshes)
            {
                // This is where the mesh orientation is set, as well as our camera and projection.
                foreach (BasicEffect effect in mesh.Effects)
                {
XNA stuff here, but it seems like this is going through all the meshes in whatever terrainModel is, which I assume is the object you're trying to render. Then it's going through each effect, and I have no idea what that is. But moving on...

code:
                    effect.EnableDefaultLighting();
Enables default lighting. Who would have thought?

code:
                    effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateRotationY(modelRotation)
                        * Matrix.CreateTranslation(modelPosition);
Sets the location of the object. It first applies everything from its parent, then rotates it as it needs to be rotated, then translates it to where it needs to be. However, the rotation only seems to be around the Y axis. Again, I don't know XNA, but this seems like it could be problematic.

code:
                    effect.View = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up);

Set the camera up. You only need to do this once, not for each model you're putting in the program, assuming XNA doesn't have some crazy thing for cameras.

code:

                    effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
                        aspectRatio, 1.0f, 10000.0f);

Sets the perspective. Like the camera, this only needs to be done once assuming I'm not missing something.

code:

                }
                // Draw the mesh, using the effects set above.
                mesh.Draw();
            }
And then it draws. Hopefully this is helpful. If I've messed up anywhere, let me know. Like I said, I'm only learning DirectX but I know graphics a bit and some of this stuff seemed familiar.

Hover
Jun 14, 2003

Your post hits a tree.
The tree is an ent.
The tree is angry.

The Monarch posted:

Thanks, I'm starting to get the hang of this and even though I sort of new what you're saying here already splitting it up did help. I still don't like the fact that I have to start this whole loop:

code:
foreach (ModelMesh mesh in terrainModel.Meshes) {
   foreach (BasicEffect effect in mesh.Effects) {
for each model (minus the camera and projection stuff) but I guess there's no other way.

Well you could just put it in another loop that iterates through a list of models. It's far less ugly and easier to maintain, and would do the same thing. Like:
code:
foreach (Model model in myBigListOfModels) { //the other two loops here }
Otherwise, yeah, what the guy a bit higher up said or the loops. You have to go through every mesh so you have to go through the loops. But you might as well make it nice while you do it.

Hover fucked around with this message at 05:22 on May 1, 2008

Hover
Jun 14, 2003

Your post hits a tree.
The tree is an ent.
The tree is angry.

Pfhreak posted:

The issue I'm running into with Unity is that there doesn't seem to be a consistent user story for how to appropriately collaborate with the free version. I'm used to working with SVN, but all the resources I've found online suggest that SVN and Unity do not play well together. People have been suggesting dropbox as well, but others suggest that is a maniac idea.

Just dropping in quickly to give my advice regarding SVN and Unity.

I worked on a project of 7 people using Unity and SVN and the only caveat was there was a folder called "Library" that contained a bunch of weird Unity-specific files that caused some sort of mess. I didn't personally look into it so I don't know all the specifics, but we got around it apparently by zipping up the Library folder whenever we made changes that affected it and everyone could unzip it on their end. It was kind of a pain in the rear end, especially because only one person could make "library" changes at a time, but it might be a decent solution for a dynamic duo instead of a sizable team.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply