spec_obj.txt

来自「最新osg包」· 文本 代码 · 共 2,160 行 · 第 1/5 页

TXT
2,160
字号
format:o       Beziero       basis matrixo       B-splineo       Cardinalo       TaylorYou can apply these types only to curves and surfaces. Each of thesefive types can be rational or non-rational.In addition to specifying the type, you must define the degree for thecurve or surface. For basis matrix curve and surface elements, you mustalso specify the basis matrix and step size.All free-form curve and surface attribute statements are state-setting.This means that once an attribute statement is set, it applies to allelements that follow until it is reset to a different value.SyntaxThe following syntax statements are listed in order of use.cstype rat type    Free-form geometry statement.    Specifies the type of curve or surface and indicates a rational or    non-rational form.    rat is an optional argument.    rat specifies a rational form for the curve or surface type. If rat    is not included, the curve or surface is non-rational    type specifies the curve or surface type. Allowed types are:	bmatrix		basis matrix	bezier		Bezier	bspline		B-spline	cardinal        Cardinal	taylor		Taylor    There is no default. A value must be supplied.deg degu degv    Free-form geometry statement.    Sets the polynomial degree for curves and surfaces.    degu is the degree in the u direction. It is required for both    curves and surfaces.    degv is the degree in the v direction. It is required only for    surfaces. For Bezier, B-spline, Taylor, and basis matrix, there is    no default; a value must be supplied. For Cardinal, the degree is    always 3. If some other value is given for Cardinal, it will be    ignored.bmat u matrixbmat v matrix    Free-form geometry statement.    Sets the basis matrices used for basis matrix curves and surfaces.    The u and v values must be specified in separate bmat statements.    NOTE: The deg statement must be given before the bmat statements    and the size of the matrix must be appropriate for the degree.    u specifies that the basis matrix is applied in the u direction.    v specifies that the basis matrix is applied in the v direction.    matrix lists the contents of the basis matrix with column subscript    j varying the fastest. If n is the degree in the given u or v    direction, the matrix (i,j) should be of size (n + 1) x (n + 1).    There is no default. A value must be supplied.    NOTE: The arrangement of the matrix is different from that commonly    found in other references. For more information, see the examples    at the end of this section and also the section, "Mathematics for    free-form curves and surfaces."step stepu stepv    Free-form geometry statement.    Sets the step size for curves and surfaces that use a basis    matrix.    stepu is the step size in the u direction. It is required for both    curves and surfaces that use a basis matrix.    stepv is the step size in the v direction. It is required only for    surfaces that use a basis matrix. There is no default. A value must    be supplied.    When a curve or surface is being evaluated and a transition from    one segment or patch to the next occurs, the set of control points    used is incremented by the step size. The appropriate step size    depends on the representation type, which is expressed through the    basis matrix, and on the degree.    That is, suppose we are given a curve with k control points:			{v , ... v }			  1       k    If the curve is of degree n, then n + 1 control points are needed    for each polynomial segment. If the step size is given as s, then    the ith polynomial segment, where i = 0 is the first segment, will    use the control points:			{v    ,...,v      }			  is+1      is+n+1    For example, for Bezier curves, s = n .    For surfaces, the above description applies independently to each    parametric direction.    When you create a file which uses the basis matrix type, be sure to    specify a step size appropriate for the current curve or surface    representation.Examples1.      Cubic Bezier surface made with a basis matrix    To create a cubic Bezier surface:	cstype bmatrix	deg 3 3	step 3 3	bmat u  1       -3      3       -1      \		0       3       -6      3       \		0       0       3       -3      \		0       0       0       1	bmat v  1       -3      3       -1      \		0       3       -6      3       \		0       0       3       -3      \		0       0       0       12.      Hermite curve made with a basis matrix    To create a Hermite curve:	cstype bmatrix	deg 3	step 2	bmat u  1     0     -3      2      0       0       3      -2 \		0     1     -2      1      0       0      -1       13.      Bezier in u direction with B-spline in v direction;	made with a basis matrix    To create a surface with a cubic Bezier in the u direction and    cubic uniform B-spline in the v direction:	cstype bmatrix	deg 3 3	step 3 1	bmat u  1      -3       3      -1 \		0       3      -6       3 \		0       0       3      -3 \		0       0       0       1	bmat v  0.16666 -0.50000  0.50000 -0.16666 \		0.66666  0.00000 -1.00000  0.50000 \		0.16666  0.50000  0.50000 -0.50000 \		0.00000  0.00000  0.00000  0.16666ElementsFor polygonal geometry, the element types available in the .obj fileare:o       pointso       lineso       facesFor free-form geometry, the element types available in the .obj fileare:o       curveo       2D curve on a surfaceo       surfaceAll elements can be freely intermixed in the file.Referencing vertex dataFor all elements, reference numbers are used to identify geometricvertices, texture vertices, vertex normals, and parameter spacevertices.Each of these types of vertices is numbered separately, starting with1. This means that the first geometric vertex in the file is 1, thesecond is 2, and so on. The first texture vertex in the file is 1, thesecond is 2, and so on. The numbering continues sequentially throughoutthe entire file. Frequently, files have multiple lists of vertex data.This numbering sequence continues even when vertex data is separated byother data.In addition to counting vertices down from the top of the first list inthe file, you can also count vertices back up the list from anelement's position in the file. When you count up the list from anelement, the reference numbers are negative. A reference number of -1indicates the vertex immediately above the element. A reference numberof -2 indicates two references above and so on.Referencing groups of verticesSome elements, such as faces and surfaces, may have a triplet ofnumbers that reference vertex data.These numbers are the referencenumbers for a geometric vertex, a texture vertex, and a vertex normal.Each triplet of numbers specifies a geometric vertex, texture vertex,and vertex normal. The reference numbers must be in order and mustseparated by slashes (/).o       The first reference number is the geometric vertex.o       The second reference number is the texture vertex. It follows	the first slash.o       The third reference number is the vertex normal. It follows the	second slash.There is no space between numbers and the slashes. There may be morethan one series of geometric vertex/texture vertex/vertex normalnumbers on a line.The following is a portion of a sample file for a four-sided faceelement:    f 1/1/1 2/2/2 3/3/3 4/4/4Using v, vt, and vn to represent geometric vertices, texture vertices,and vertex normals, the statement would read:    f v/vt/vn v/vt/vn v/vt/vn v/vt/vnIf there are only vertices and vertex normals for a face element (notexture vertices), you would enter two slashes (//). For example, tospecify only the vertex and vertex normal reference numbers, you wouldenter:    f 1//1 2//2 3//3 4//4When you are using a series of triplets, you must be consistent in theway you reference the vertex data. For example, it is illegal to givevertex normals for some vertices, but not all.The following is an example of an illegal statement.    f 1/1/1 2/2/2 3//3 4//4SyntaxThe following syntax statements are listed in order of complexity ofgeometry.p  v1 v2 v3 . . .    Polygonal geometry statement.    Specifies a point element and its vertex. You can specify multiple    points with this statement. Although points cannot be shaded or    rendered, they are used by other Advanced Visualizer programs.    v is the vertex reference number for a point element. Each point    element requires one vertex. Positive values indicate absolute    vertex numbers. Negative values indicate relative vertex numbers.l  v1/vt1   v2/vt2   v3/vt3 . . .    Polygonal geometry statement.    Specifies a line and its vertex reference numbers. You can    optionally include the texture vertex reference numbers. Although    lines cannot be shaded or rendered, they are used by other Advanced    Visualizer programs.    The reference numbers for the vertices and texture vertices must be    separated by a slash (/). There is no space between the number and    the slash.    v is a reference number for a vertex on the line. A minimum of two    vertex numbers are required. There is no limit on the maximum.    Positive values indicate absolute vertex numbers. Negative values    indicate relative vertex numbers.    vt is an optional argument.    vt is the reference number for a texture vertex in the line    element. It must always follow the first slash.f  v1/vt1/vn1   v2/vt2/vn2   v3/vt3/vn3 . . .    Polygonal geometry statement.    Specifies a face element and its vertex reference number. You can    optionally include the texture vertex and vertex normal reference    numbers.    The reference numbers for the vertices, texture vertices, and    vertex normals must be separated by slashes (/). There is no space    between the number and the slash.    v is the reference number for a vertex in the face element. A    minimum of three vertices are required.    vt is an optional argument.    vt is the reference number for a texture vertex in the face    element. It always follows the first slash.    vn is an optional argument.    vn is the reference number for a vertex normal in the face element.    It must always follow the second slash.    Face elements use surface normals to indicate their orientation. If    vertices are ordered counterclockwise around the face, both the    face and the normal will point toward the viewer. If the vertex    ordering is clockwise, both will point away from the viewer. If    vertex normals are assigned, they should point in the general    direction of the surface normal, otherwise unpredictable results    may occur.    If a face has a texture map assigned to it and no texture vertices    are assigned in the f statement, the texture map is ignored when    the element is rendered.    NOTE: Any references to fo (face outline) are no longer valid as of    version 2.11. You can use f (face) to get the same results.    References to fo in existing .obj files will still be read,    however, they will be written out as f when the file is saved.curv u0 u1 v1 v2 . . .    Element statement for free-form geometry.    Specifies a curve, its parameter range, and its control vertices.    Although curves cannot be shaded or rendered, they are used by    other Advanced Visualizer programs.    u0 is the starting parameter value for the curve. This is a    floating point number.    u1 is the ending parameter value for the curve. This is a floating    point number.    v is the vertex reference number for a control point. You can    specify multiple control points. A minimum of two control points    are required for a curve.    For a non-rational curve, the control points must be 3D. For a    rational curve, the control points are 3D or 4D. The fourth    coordinate (weight) defaults to 1.0 if omitted.curv2  vp1  vp2   vp3. . .    Free-form geometry statement.    Specifies a 2D curve on a surface and its control points. A 2D    curve is used as an outer or inner trimming curve, as a special    curve, or for connectivity.    vp is the parameter vertex reference number for the control point.    You can specify multiple control points. A minimum of two control    points is required for a 2D curve.    The control points are parameter vertices because the curve must    lie in the parameter space of some surface. For a non-rational    curve, the control vertices can be 2D. For a rational curve, the    control vertices can be 2D or 3D. The third coordinate (weight)    defaults to 1.0 if omitted.surf  s0  s1  t0  t1  v1/vt1/vn1   v2/vt2/vn2 . . .    Element statement for free-form geometry.    Specifies a surface, its parameter range, and its control vertices.    The surface is evaluated within the global parameter range from s0    to s1 in the u direction and t0 to t1 in the v direction.    s0 is the starting parameter value for the surface in the u    direction.    s1 is the ending parameter value for the surface in the u    direction.    t0 is the starting parameter value for the surface in the v    direction.    t1 is the ending parameter value for the surface in the v    direction.    v is the reference number for a control vertex in the surface.    vt is an optional argument.    vt is the reference number for a texture vertex in the surface.  It    must always follow the first slash.    vn is an optional argument.    vn is the reference number for a vertex normal in the surface.  It    must always follow the second slash.    For a non-rational surface, the control vertices are 3D.  For a    rational surface the control vertices can be 3D or 4D.  The fourth    coordinate (weight) defaults to 1.0 if ommitted.    NOTE: For more information on the ordering of control points for

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?