XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

Map Designer/Level Designer & Bounding Spheres

Last post 11/3/2007 5:20 PM by Dead Illusionist. 5 replies.
  • 11/2/2007 12:59 AM

    Map Designer/Level Designer & Bounding Spheres

    How would one go about creating a level designer to create 3d levels, using a Windows Form(Windows App), or an XNA Form(Game App)? I've never understood how people can put such windows app functionality into a (Windows Form)level designer while having xna graphics from your game you created using XNA and referencing to a model or texture or anything else that requires XNA to do....

    How would I make it so that EVERY renderable object in my game can have a bounding sphere around it? I watched one of Bungie Studios' videos on how they made Halo 3 and I thought it was cool that they had a bounding sphere surrounding every object in their game in which they used to check for collisions and so forth......

    Dead_Illusionist
  • 11/2/2007 2:37 PM In reply to

    Re: Map Designer/Level Designer & Bounding Spheres

    Take a look at this: http://forums.xna.com/thread/16288.aspx

    That's how you get a Game class embedded into a form and get them playing nicely with each other.  Note: I recommend passing IntPtr.Zero to PeekMessage for best results in the AppIsIdle method.  I have used this with very complex windows form interfaces (similar to visual studio, where the XNA window was like a VS document window) and it works great!  They really need to sticky that link, b/c this question gets asked often.  Note that XNA 2 is going to feature enhanced WinForms support, so if you're patient you can wait for that, but the above method also works excellent.

    For the Model class, each MeshPart has a bounding sphere, so if you are using only Models, you already have bounding spheres for everything!  Otherwise you can make a scene manager implementation and create a bounding sphere property for each one, to use as you please.
  • 11/2/2007 2:47 PM In reply to

    Re: Map Designer/Level Designer & Bounding Spheres

    Pfo: Feel free to write your own FAQ and add all the links... I will happily rewrite it later if you want to just collect all the information about winforms in one place. I even wrote an FAQ on how to make an FAQ. Making topics sticky gets messy as there is so much stuff that we need to make sticky - much better to collect links in an FAQ. This will be very important going forward since 2.0 recently dropped the winforms feature - see the GS 2.0 FAQ

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 11/2/2007 4:26 PM In reply to

    Re: Map Designer/Level Designer & Bounding Spheres

    "How would I make it so that EVERY renderable object in my game can have a bounding sphere around it?"

    Simply compute the max extent of your object (assuming its origin is normalized) and you have the radius for a virtual sphere for radius level collision.

    If you wanted to visualize a sphere like that simply make a unit sphere (radius 1) model and bring it in the normal content pipeline.  Give it an effect with semi-transparency (say alpha blend value of about 0.2) and feed it to the rendering engine with the same world transform as your model and a scale transform set to your models max extent (also multiply by your models scaling if any)

     

    "How would one go about creating a level designer to create 3d levels,"

    I suspect a 3d modeler package is probably even a more involved project than a 3d game...  I suggest finding some other modeler and find a "just works" solution.  XSI 6 Mod tool looks excellent, although it seems way over my head for the time being.  I am using Sketchup, although you will need to pro version to make xna compatible files.

    I don't want to put you off making a level designer however.  But look at the triangle picking sample before you commit to such a thing...

  • 11/3/2007 8:10 AM In reply to

    Re: Map Designer/Level Designer & Bounding Spheres

    The BoundingSphere has a CreateMerged function, which, if it works like the BoundingBox CreateMerged function -

     - You input two spheres, it returns a sphere that contains both spheres. Run through the mesh objects and merge the BoundingSpheres into one big sphere.
  • 11/3/2007 5:20 PM In reply to

    Re: Map Designer/Level Designer & Bounding Spheres

    Ok, so if I had like an emulation engine or sumthin like that where it wasn't my full game but just showed me all the models/objects and no textures and just the bounding sphere surrounding all models in it how would I make it so that my bounding sphere would be visible around a model? Like if there was a collision with another model it would turn another color to let me know that there was a collision between the two objects?
    Dead_Illusionist
Page 1 of 1 (6 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG