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

Hollow Cylinders of Gatling Gun 3d model Render Incorrectly

Last post 03/07/2009 7:45 by AlectoPerfecto. 3 replies.
  • 25/06/2009 18:30

    Hollow Cylinders of Gatling Gun 3d model Render Incorrectly

    I will keep this as simple as possible.

    I have created a model of a gatling gun in blender. (free 3d modeller)
    Gatling gun has hollow barrels through which bullets fly and come out of.
    I have exported it into an fbx format and successfully loaded it in xna.

    Picture of what it should look like from blender:


    Picture of what it renders like on xna


    If i take of backface culling or whatever by implementing this code
    • 'GraphicsDevice.RenderState.CullMode = CullMode.None;'
    Then it renders almost correclty like this:



    In the culling mode set i suspect the only problem is to fix the lighting so that you can see shadows inside the barrells.

    Is there a better solution in which i can have culling enabled, as i have read that disabling culling mode will greatly decrease performance, when using a large number of models and such.

    Has anyone got some tips for me on how to do some lighting so that i can see shadows inside the barrells?

    Stu
  • 25/06/2009 18:55 In reply to

    Re: Hollow Cylinders of Gatling Gun 3d model Render Incorrectly

    It means that the order of the verts of the triangles on the inside of the barrel are in the reverse order they should be. I am not familiar with blender, but most 3d modelling software allows you to select faces and reverse the vertex order. That should solve your problem.
    Regards,
    Louis Ingenthron
    Fortis Venaliter
    Lead Developer of FV ProductionsFV Productions
  • 26/06/2009 6:24 In reply to

    Re: Hollow Cylinders of Gatling Gun 3d model Render Incorrectly

    Cheers for your advice fortis, but I woke up this morning after having spent hours and hours on it last night and realised that i had modelled my model in blender wrong and that all i had done was extrude the barrell vertices at the end to create a flap at the end so to speak, rather than having a full cylinder within the outside cylinder so to speak.  I have remoddelled the barrels now and it renders nicely without the backface culling problem, however lighting/shading is still a problem that i will need to sort. Is it best to use the http://creators.xna.com/en-US/sample/shader_series1 in order to create simple lighting?

    Stu



  • 03/07/2009 7:45 In reply to

    Re: Hollow Cylinders of Gatling Gun 3d model Render Incorrectly

    Thanks man.  You helped me with the RenderCullMode.None thing.  I was wondering where the other half of my armor was.
Page 1 of 1 (4 items) Previous Next