OBJ2OPENGL Convert OBJ file to OpenGL format

本文介绍了一个Perl脚本obj2opengl,它读取描述三维对象的OBJ文件,并生成适用于OpenGL的C语言包含文件。脚本提供了几个示例文件,包括简单立方体和复杂形状如南瓜,用于展示如何使用生成的包含文件。此外,文章还介绍了与OBJ文件格式转换相关的其他工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

OBJ2OPENGL is a PERL script that reads an OBJ file describing a 3D object, and writes a C include file describing the object in a form suitable for use with Open GL.

To see how to use the include file created by this program, refer to the example in the Open GL examples directory.

The author wishes to point out that this script was developed for a specific purpose, and was not intended to be able to handle all variations of the OBJ file format.

Related Data and Programs:

IVCON is an executable C++ program which can convert graphics information between OBJ and other formats.

IVREAD is an executable FORTRAN90 program which can convert graphics information between OBJ and other formats.

OBJ is a data directory which has some examples of OBJ files.

OBJ_2_PLY is an executable C program which reads an OBJ file and writes similar information to a PLY file.

OBJ_IO is a library of FORTRAN90 routines which transfer graphics information to and from OBJ files.

PLY_TO_OBJ is a C program which reads a PLY 3D graphics file and writes an equivalent OBJ graphics file.

TEC_TO_OBJ is an executable FORTRAN90 program which can read a TECPLOT file describing a surface in 3D composed of triangles or quadrilaterals, and write an OBJ file.

Usage:

obj2opengl  file.obj
reads  file.obj and writes an INCLUDE file.

Author:

Margaret Geroch
Associate Professor,
Wheeling Jesuit University,
Wheeling, West Virginia.

Reference:

Source Code:

Files you may copy include (for some loopy security reason, we must avoid the "PL" extension on the source code as distributed here:

  • obj2opengl.perl, the source code (your copy will have a "PERL" extension, which you will probably want to change back to "pl");
  • graphicsDefs.h, an include file that will be needed when the C file is compiled;

Examples and Tests:

CUBE is a simple cube. Files you may copy include:

GOURD is a complicated shape that represents a gourd. Files you may copy include:

You can go up one level to the PERL source codes.


Last revised on 30 October 2007.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值