Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Go Back  Xtreme Visual Basic Talk > > > > Save vertex buffer information to mesh Question


Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2009, 03:10 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Question Save vertex buffer information to mesh Question


The title says it all. I'm trying to save the information I have in my vertex buffer into a mesh file. I'm not even sure where to start (other than graphics stream) any suggestions.
Reply With Quote
  #2  
Old 04-30-2009, 11:23 AM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Lightbulb ah ha !!!

Code:
        xMesh = New Mesh(xMesh.NumberFaces, xMesh.NumberVertices, MeshFlags.Managed, CustomVertex.PositionColored.Format, nDevice)
        xMesh.SetVertexBufferData(vertices, LockFlags.None)
        xMesh.SetIndexBufferData(indices, LockFlags.None)
        Dim adjac(xMesh.NumberFaces * 3) As Integer
        xMesh.GenerateAdjacency(0.5F, adjac)
        xMesh.OptimizeInPlace(MeshFlags.OptimizeVertexCache, adjac)
        xMesh.Save(FileName, adjac,ExMaterials, XFileFormat.Text)
Here is some generic pseudo code. This should work in most instances. Make sure to dispose of your buffers when you close your application or else you will get a lot of errors. The ExtendedMaterials is the materials you use to texture your mesh , if your mesh is just points and colors this code may not work correctly it might save a blank file. Play around and tweek the code and I'm sure you can get it to work with whatever your needs are.
Reply With Quote
  #3  
Old 05-22-2009, 05:33 AM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

do you wish to create an X file or just save the data. if it the latter, you can write the vertecies to the file first, then the index data afterwards, before finally reading the texture file needed. thats basically all that is needed to be saved.
If you want you can write the vertex description too, but it probly won't be needed as i take it wou'll create it manually.
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
 
Save vertex buffer information to mesh Question
Save vertex buffer information to mesh Question
 
-->