XNA Game Development Forums
2012/05/22 14:06:58 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Map  (Read 3215 times)
Jonotron
Newbie
*
Offline Offline

Posts: 27


View Profile
Map
« on: 2006/08/09 03:59:00 »

Hey, glad you got a forum up!  I would like to know how you'd make a terrain like this one:
http://www.c-unit.com/tutorials/mdirectx/?t=42
except, just making a flat map, not a height map.
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #1 on: 2006/08/09 09:00:06 »

Not sure what you mean by 'flat map'. Can you clarify?
Logged
chadmv
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #2 on: 2006/08/09 11:44:30 »

Maybe he means like a minimap or radar.
Logged
Jonotron
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #3 on: 2006/08/09 12:23:04 »

Sorry for the confusion, it was late when I wrote that.  I mean ground to for an object to move on.
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #4 on: 2006/08/09 12:27:36 »

Well, you could go about this a lot of ways. If you wanted an entirely flat surface to move things on (as in a small physics engine test, or maybe a simple track racing game) you could simply use a single quad that has a texture scaled to full (or repeated depending on your needs) and just tell the objects in the game that the ground plane is at that object's height.

You could also do a much larger level with multiple quads so that you could cull them when they are outside the frustum (although with single quads, culling would be entirely unneccessary). Chad (chadmv) has a culling tutorial over at c-unit that works with his engine setup.
« Last Edit: 2008/09/17 08:29:52 by mikeschuld » Logged
Jonotron
Newbie
*
Offline Offline

Posts: 27


View Profile
« Reply #5 on: 2006/08/09 12:47:13 »

Thanks, I'm just trying to test out a simple terrain(ground) class.  I think making multiple quads would be best.  I've looked at the C-Unit tutorials and I like them, but it doesn't explain the framework enough, so I get lost after a while.  For creating a grid of quads, would I use VertexGroup? like this:
Code:
            verts = new CustomVertex.PositionTextured[4];
            /*
             * gotta edit the next few lines
             */
            verts[0] = new CustomVertex.PositionTextured(new Vector3(-1, -1, 1), 0, 0);
            verts[1] = new CustomVertex.PositionTextured(new Vector3(1, -1, 1), 1, 0);
            verts[2] = new CustomVertex.PositionTextured(new Vector3(-1, -1, -1), 0, 1);
            verts[3] = new CustomVertex.PositionTextured(new Vector3(1, -1, -1), 1, 1);
            ground = new VertexGroup(verts, inds, texture, myDevice);
If so, how do I edit the "new Vector3(#, #, #)" part to specify how many quads per x axis and per z axis?
« Last Edit: 2006/08/09 12:50:06 by Jonotron » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.072 seconds with 17 queries.