4 Replies - 3912 Views - Last Post: 24 August 2012 - 06:34 AM

#1 ArchColossus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-February 12

Looking for pointers with a 3d project.

Posted 19 August 2012 - 08:01 PM

I'm looking to make a program that loads a simple 3d map off of a bitmap image. I'm capable of reading the bitmap into an array, and drawing various primitives, but I'm having a tough time getting things in the right spot. I'm trying to make a map that looks similar to Markus Persson's Prelude of the Chambered. So just a simple dungeon crawler-esque map. I'm having trouble getting the "floor" tiles to line up. I guess the question is closer to this, how do I take the information from the array and load the tiles correctly? I'm completely restarting this project, as I've managed to mess it up quite a few times. Google has not been my friend for this either. But I've gotten help here before, so I figured I'd try again. :D Thank you in advance for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: Looking for pointers with a 3d project.

#2 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 314
  • View blog
  • Posts: 490
  • Joined: 13-June 12

Re: Looking for pointers with a 3d project.

Posted 20 August 2012 - 12:31 AM

Perhaps this tutorial from Reimers will help you get started?

Is your map being created from a tiled image, or simply hand-drawn with colours representing different heights/texture (which I seem to remember is how Prelude of the Chambered was done)?
Was This Post Helpful? 0
  • +
  • -

#3 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 592
  • View blog
  • Posts: 1,322
  • Joined: 24-April 12

Re: Looking for pointers with a 3d project.

Posted 20 August 2012 - 06:12 AM

Apparently, I don't have Java on this computer. So, I can't view the page that you linked. But if you're wanting to do floor tiles based on an array, I may have just what you're looking for.

I'm in the process of writing my second 3D tutorial, and it's supposed to be an "interior level editor". Currently, I'm building a prototype of it; the plan being that once I've gotten the prototype working and debugged I can then go back and build basically the same thing step by step for a tutorial.

Anyway, I posted the code for the prototype on my website a couple of weeks ago for someone that was wanting to take a look at it. It's still there and you can download the whole project. Keep in mind that it's "prototype" code, which means it's not properly commented or documented. And it's still a work in progress. But the project as posted allows you to define a grid as an array and assign floor tiles to each quad of the grid. It allows for 64 different tile types and 4 rotations for each. You can also turn the grid on and off by hitting the G key. And there's camera code for a human camera that allows you to walk around the scene similar to the way people walk. And then there's a quaternion camera that basically "flys" around the scene.

We were also working on figuring out how to use quaternions and so there's a box in that version that is controlled with quaternions. It's movement is with the number pad.

Anyway, you may want to check it out since it has floor tiles, and it sounds like exactly what you're trying to do. It's working code for you to look at anyway.

http://xna-3d-101.co...ndTutorial.html

Let me know if that helps or doesn't help. If for example, you're actually trying to do a terrain with hills and valleys, I can maybe give you some direction on that as well. So, if this isn't what you're looking for (or even if it is) let me know.

P.S. I did a search on Prelude of the Chambered and I got to see what you're talking about. I think my level editor project is pretty close to what you're wanting to do there, although the video for PotC looked a lot like MineCraft, which is not really what I was going for for my level editor. It said that PotC was put together as part of a "make a game in 48 hours" competition. So, they may have been keeping it low rez and making everything pretty "blocky" just to keep the scope of the project simple. Anyway, I'm trying to do a more "realistic" level editor.

For the walls, I'm actually modeling them in Blender. For the prototype I made the walls pretty flat and blocky, but you could actually model the walls with a lot of details and such and they would work the same.

Anyway, I think I've changed a few things since the code that was posted. I think I also added a grid for ceiling tiles, removed the floating box (since that really had nothing to do with the project), and setup an "area" grid for wall "units". While the floor tiles are 1 meter in size, the "areas" are 3 by 3 grid units(meters) in size. The wall units are 3 by 3 wall models that have between 1 and 4 walls that can be placed into an area and rotated, allowing you to build a modular interior(or dungeon).

That's about where I'm at currently. I've built enough wall units to basically test with, but have not built all of the wall shapes needed yet. I was supposed to be working on wall collision this past weekend, but got side tracked with other things around the house and then spent what little XNA time I had this weekend learning High Level Shader Language.

Anyway, I say all that to tell you that if you're interested in seeing the newer version of the code, I could probably post that if you wanted me to. The big addition is walls and a ceiling.

This post has been edited by BBeck: 20 August 2012 - 06:29 AM

Was This Post Helpful? 0
  • +
  • -

#4 ArchColossus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-February 12

Re: Looking for pointers with a 3d project.

Posted 22 August 2012 - 02:51 PM

I actually tried converting Reimer's flightsim tutorial into my project but it didn't work. Of course meaning I did it wrong. :P But BBeck what you're doing sounds immensely helpful, and I'll be looking into it. Thank you for the help. I'll be looking into this more once I have a bit of free time.
Was This Post Helpful? 0
  • +
  • -

#5 ArchColossus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-February 12

Re: Looking for pointers with a 3d project.

Posted 24 August 2012 - 06:34 AM

I took a look through the code you had posted on your site, but it's a bit advanced for me. So I'll be waiting for the full tutorial so I can take another run through. It does seem VERY helpful to me. I'll be tinkering around to learn all the what-does-what, because that's how I've learned XNA so far. Already it's helping me further my abilities. Thank you for your help, I'll be following this tutorial.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1