zoukankan      html  css  js  c++  java
  • Object Files (.obj)

    文件格式


    以#号开始的为注释行。

    An OBJ file contains several types of definitions:


    Face definitions

    面片的定义使用顶点坐标、贴图坐标和法向量坐标的索引。

    Faces are defined using lists of vertex, texture and normal indices. Polygons such as quadrilaterals can be defined by using more than three vertex/texture/normal indices.

    OBJ files also support free form curved surface objects such as NURB surfaces.

    There are several ways to define a face, but each face line definition starts with "f" character.


    Vertex

    A valid vertex index starts from 1 and match first vertex element of vertex list previously defined. Each face can contain more than three elements.

    表示这个面片由顶点列表中的第v1个顶点、第v2个顶点、第v3个顶点和第v4个顶点连接而成。

    索引值从1开始。(也可以取负值,表示从最后一个顶点开始数上去。)

    Vertex/texture-coordinate

    Each texture coordinate index must follow with no space the first slash. Texture coordinates index are optional. A valid texture coordinate index starts from 1 and match first texture coordinate element of texture coordinate list previously defined. Each face can contain more than three elements.

    Vertex/texture-coordinate/normal

    Each normal index must follow with no space the second slash. Normals index are optional. A valid normal index starts from 1 and match first normal element of normal list previously defined. Each face can contain more than three elements.

    Vertex/normal

    As texture coordinates are optional, one can define geometry without them, but one must put the normal index after second slash.


    References:

    http://en.wikipedia.org/wiki/Wavefront_.obj_file

    http://people.sc.fsu.edu/~jburkardt/txt/obj_format.txt

    http://www.cppblog.com/lovedday/archive/2008/06/13/53153.html

    http://mailao.ycool.com/post.1905836.html

  • 相关阅读:
    装饰器函数(一)
    面向对象的初阶复习
    内置函数/反射/内置方法(单例类面)
    property特殊属性/类方法/静态方法
    多态/封装
    接口类抽象类
    初始继承之顺序/深度优先及广度优先
    类涉及的空间关系及组合(可变项地址面)
    <head></head>
    让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
  • 原文地址:https://www.cnblogs.com/funway/p/1978646.html
Copyright © 2011-2022 走看看