Visually Rendering DetectorVolume?
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Visually Rendering DetectorVolume?
How can this be accomplished?
Re: Visually Rendering DetectorVolume?
A detector volume takes a TriangleMesh in the constructor, so you can render that TriangleMesh somehow or render the model that is the source of the TriangleMesh. You may want to also set GraphicsDevice.RenderState.FillMode = FillMode.WireFrame when you draw the detector's mesh. The renderer in the demo just draws the detector's model.
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Re: Visually Rendering DetectorVolume?
What if I've created the TriangleMesh from scratch ( a set of manually created vertices and indices) and don't have a 3D model to render as a DisplayObject?
If I create a StaticTriangleGroup, I don't see a way to render that unless I also render the 3D model used to create the StaticTriangleGroup.
If I create a StaticTriangleGroup, I don't see a way to render that unless I also render the 3D model used to create the StaticTriangleGroup.
Re: Visually Rendering DetectorVolume?
While the demos renderer have no built in renderer for that particular case, it is pretty similar. The TriangleMesh already has a vertex list and index list. You can convert them into a format that the graphics card likes (a VertexBuffer and IndexBuffer, for example) and just use a draw (indexed) primitives call.
Here's a little introduction to it:
http://msdn.microsoft.com/en-us/library/bb196414.aspx
There's also a lot of other resources floating around the internet, and I'm guessing you could find something in XNA creator's website samples too.
Here's a little introduction to it:
http://msdn.microsoft.com/en-us/library/bb196414.aspx
There's also a lot of other resources floating around the internet, and I'm guessing you could find something in XNA creator's website samples too.