Here is a litte sample that I drew in Blender to visualize what I am planing to create:

Cone with spheres sample

I already have the code to generate the cone and the spheres as mentioned in my former Post Combine 3D objects in XNA 4.

I thought that it would be nicer to generate a model and add these models to the sceen graph. My problem for now is that I wasn't able to generate a model out of my primitivas. I was planning to create one Mesh for the cone and one for each sphere that I want to attach to the cone and arrange all this in a Model, but there are no constructors for a Model or a Mesh.

So the question is: Is there a way to generate a model out of my primitives?


1 Answer 1


If you want to create Model or Mesh objects, you do so in the content pipeline (via their builder counterparts). They aren't types you can create during run time (unless you run on Windows and willing to include the pipeline builder library in your game project). They're also sealed so no extending them.

Model objects are basically just a collection of meshes, bones, and an optional effect. Meshes are just a wrapper around a vertex and index buffer.

So your options:

  • Make your own version of the model/mesh class that can be generated at run-time.
  • Look into the content pipeline to pre-build Model objects. It's relatively easy as long as you're okay with having the primitive mesh be unchangeable at run-time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .