Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads
 
Add your own
alternative version
Go to top

Achieving PostScript and Wmf outputs for OpenGL

, 9 Jun 2003
This article explains how to generate resolution independent versions of 3D meshes rendered by OpenGL/MFC programs, i.e. how to export the rendering results to vectorial formats such as encapsulated postscript (EPS) and Windows enhanced metafile (EMF) formats. The main goal consists of being able to
gl_export.zip
Src
Mesh.dsp
Mesh.dsw
Mesh.plg
Mesh.aps
Mesh.clw
Lib3D
res
Mesh.ico
MeshDoc.ico
Toolbar.bmp
Mesh.ncb
Mesh.opt
Bin
knot2.wrl
mnt.wrl
mannequin.wrl
venus.wrl
knot1.wrl
nefertiti.wrl
geosphere.wrl
metafile.emf
Mesh.exe
samples_eps.zip
nefertiti_flat.eps
nefertiti_line_light.eps
nefertiti_line.eps
nefertiti_line_color.eps
nefertiti_smooth_light.eps
nefertiti_line_smooth_light.eps
nefertiti_vertex_color.eps
sample_ppt.zip
sample.ppt
//********************************************
// Edge3d.h
// class CEdge3d
//********************************************
// An edge :
// + Two vertex ref
// + Two neighbors ref
// + A flag
//********************************************
// alliez@usc.edu
// Created : 15/12/97
// Modified : 18/02/98
//********************************************

#ifndef _EDGE_3D_
#define _EDGE_3D_

#include "Object3d.h"

class CVertex3d;
class CFace3d;

class CEdge3d : public CObject3d
{

private :

	// Geometry
	CVertex3d *m_pVertex1;
	CVertex3d *m_pVertex2;

	CFace3d *m_pFace1;
	CFace3d *m_pFace2;

	// Flag
	char m_Flag;

public :

	CEdge3d();
	virtual ~CEdge3d() {}
	
	// Constructors
	CEdge3d(CVertex3d *pVertex1,CVertex3d *pVertex2);
	CEdge3d(CVertex3d *pVertex1,CVertex3d *pVertex2,CFace3d *pFace1,CFace3d *pFace2);
	CEdge3d(CEdge3d *pEdge);

	// Data setting
	virtual int GetType();

	// Copy Edge
	void Set(CEdge3d *pEdge);

	// Vertices
	void Set(CVertex3d *pVertex1,CVertex3d *pVertex2);
	void v1(CVertex3d *pVertex) { m_pVertex1 = pVertex; }
	void v2(CVertex3d *pVertex) { m_pVertex2 = pVertex; }

	void v(int index,CVertex3d *pVertex)
	{
		if(index == 0)
			m_pVertex1 = pVertex;
		else
			m_pVertex2 = pVertex;
	}

	// Faces
	void Set(CFace3d *pFace1,CFace3d *pFace2);
	void f1(CFace3d *pFace) { m_pFace1 = pFace; }
	void f2(CFace3d *pFace) { m_pFace2 = pFace; }
	void f(int index,CFace3d *pFace)
	{
		if(index == 0)
			m_pFace1 = pFace;
		else
			m_pFace2 = pFace;
	}

	// Vertices
	CVertex3d *v1(void) { return m_pVertex1; }
	CVertex3d *v2(void) { return m_pVertex2; }
	CVertex3d *v(int index) { return ((index == 0) ? m_pVertex1 : m_pVertex2); }
	CVertex3d *GetVertexDiff(CVertex3d *pVertexDiff);

	// Faces
	CFace3d *f1(void) { return m_pFace1; }
	CFace3d *f2(void) { return m_pFace2; }
	CFace3d *f(int index) { return ((index == 0) ? m_pFace1 : m_pFace2); }

	// Flag
	void SetFlag(char flag) { m_Flag = flag; }
	char GetFlag() { return m_Flag; }

	// Processing
	int Equal(CEdge3d *pEdge);
	int sharp(float threshold); // threshold : sin(angle)

	// OpenGL
	void glDrawHighlight(unsigned char *color);
	void glDrawHighlight(unsigned char *color,unsigned char *ColorNeighbor);

};

#endif // _EDGE_3D_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Pierre Alliez

France France
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 10 Jun 2003
Article Copyright 2001 by Pierre Alliez
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid