📄 nff
字号:
Neutral File FormatPresently the following entities are supported by the modified NFF:A simple perspective frustumA background color descriptionA positional (vs. directional) light source descriptionA surface properties descriptionTriangle descriptionsNFF files contain lines of text. For each entity, the first fielddefines its type. The rest of the line and possibly other linescontain further information about the entity.Entities include:"v" - viewing vectors and angles"b" - background color"l" - positional diffuse light location"s" - positional specular light location"f" - object material properties"pp" - triangular patch primitiveThese are explained below.Viewpoint location Template:"v""from" Fx Fy Fz"at" Ax Ay Az"up" Ux Uy Uz"angle" angle"hither" hither"yon" yon"resolution" xres yresType Specification:vfrom float float floatat float float floatup float float floatangle floathither floatyon floatresolution integer integerDescription:From: the eye location in XYZ.At: a position to be at the center of the image, in XYZ worldcoordinates. A.k.a. "lookat".Up: a vector defining which direction is up, as an XYZ vector.Angle: in degrees, defined as from the center of top pixel row tobottom pixel row and left column to right column.Hither: distance of the hither plane from the eye.Yon: distance of the yon plane from the eye.Resolution: in pixels, in x and in y (currently ignored).Note that no assumptions are made about normalizing the data (e.g. thefrom-at distance does not have to be 1). Also, vectors are notrequired to be perpendicular to each other.For all databases, the aspect ratio is 1.0.A view entity must be defined before any objects are defined.Background colorTemplate:"b" R G BType Specification:b float float floatDescription:Background color is given R,G and B values between 0 and 1. Positional Diffuse lightTemplate:"l" X Y Z IpR IpG IpBType Specification:l float float float float float floatDescription:A diffuse light is defined by its XYZ position. All light entitiesmust be defined before any objects are defined. Light source positionand its Red, Green and Blue components, in the range 0.0 to 1.0 arespecified. Up to NUM_LIGHT_SOURCES light sources can be specified.Positional Specular lightTemplate:"s" X Y Z IpR IpG IpB ks nType Specification:l float float float float float float float integerDescription:A specular light is defined by its XYZ position. All light entitiesmust be defined before any objects are defined. Light source positionand its Red, Green and Blue components, in the range 0.0 to 1.0 arespecified. At most one specular light source can be specified. Thespecular reflection coefficient (ks) in the range 0.0 to 1.0 and thespecular exponent (n) are also specified.Fill color and shading parametersTemplate:"f" OdR OdG OdB Kd Ka c1 c2 Format:f float float float float float float float floatDescription:OdR, OdG and OdB specify the object's diffuse color (RGB triple) inthe range 0.0 to 1.0. Kd is the diffuse reflection coefficient, Ka theambient reflection coefficient, c1 and c2 are the parameters for theattenuation function fatt(d) = 1/(1 + c1*d + c2 * d * d) used for thelight source where "d" is the distance of a point from the lightsource (See the textbook by Foley, van Dam, Feiner, Hughes andPhillips, Chapter 14). Usually, 0 <= Kd <= 1 and 0 <= Ka <= 1, and Kdand Ka are independent.Triangular patch Template:"pp" total_verticesvert1.x vert1.y vert1.z norm1.x norm1.y norm1.z[etc. for total_vertices vertices]Format:pp integer[float float float float float float] <-- for total_vertices verticesDescription:All objects are considered one-sided. A patch is defined by a set ofvertices and their normals. With these databases, a patch is definedto have all points coplanar. A patch has only one side, with the orderof the vertices being counterclockwise as you face the patch(right-handed coordinate system). The first two edges must form anon-zero convex angle, so that the normal and side visibility can bedetermined. Note that, since only triangular patches are supportedtotal_vertices shown must always be 3.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -