Exemplo n.º 1
0
void GeoSaver::SaveMeshes(std::vector<Scene3DMesh*> &meshes, std::ostream &os)
{
	BinaryWriter bw(&os);

	bw.Write((int)meshes.size());

	for (int i = 0; i < (int)meshes.size(); i++)
		SaveMesh(meshes[i], bw);
}
Exemplo n.º 2
0
	void Model_IO::SaveMeshes(std::vector<Mesh>& meshes, BinaryWriter& writer, const achar* path)
	{
		writer.Push((int32_t) meshes.size());

		for (auto i = 0; i < meshes.size(); i++)
		{
			SaveMesh(meshes[i], writer, path);
		}
	}
Exemplo n.º 3
0
void SaveMesh(std::string filename, const BoundedVolume<T,TargetHost> vol, const BoundedVolume<TColor,TargetHost> volColor )
{
    std::vector<aiVector3D> verts;
    std::vector<aiVector3D> norms;
    std::vector<aiFace> faces;
    std::vector<aiColor4D> colors;

    for(GLint iX = 0; iX < vol.Voxels().x-1; iX++) {
        for(GLint iY = 0; iY < vol.Voxels().y-1; iY++) {
            for(GLint iZ = 0; iZ < vol.Voxels().z-1; iZ++) {
                vMarchCube(vol, volColor, iX,iY,iZ, verts, norms, faces, colors);
            }
        }
    }

    aiMesh* mesh = MeshFromLists(verts,norms,faces,colors);
    SaveMesh(filename, mesh);
}
Exemplo n.º 4
0
  void Ngx_Mesh :: DoArchive (ngstd::Archive & archive)
  {

    if (archive.Output())
      {
        stringstream str;
        SaveMesh (str);
        string st = str.str();
        archive & st;
      }
    else
      {
        string st;
        archive & st;
        stringstream str(st);
        LoadMesh (str);
      }
  }