1 ! Copyright (C) 2010 Erik Charlebois
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs game.models.obj.private help.markup help.syntax
4 io.pathnames kernel sequences strings ;
7 ABOUT: "game.models.obj"
9 ARTICLE: "game.models.obj" "Conversion of Wavefront OBJ assets"
10 "The " { $vocab-link "game.models.obj" } " vocabulary implements words for converting Wavefront OBJ assets to data suitable for use with OpenGL." ;
13 { $class-description "Tuple describing the GPU state that needs to be applied prior to rendering geometry tagged with this material." } ;
16 { $values { "current-material" material } }
17 { $description "Convenience word for accessing the current material while parsing primitives." } ;
20 { $values { "material-dictionary" assoc } }
21 { $description "Convenience word for accessing the material dictionary while parsing primitives. " } ;
24 { $values { "strings" sequence } { "numbers" sequence } }
25 { $description "Convert a sequence of strings to a sequence of numbers." } ;
28 { $values { "strings" sequence } { "faces" sequence } }
29 { $description "Convert a sequence of '/'-delimited strings into a sequence of sequences of numbers. Each number is an index into the vertex, texture or normal tables, respectively." } ;
32 { $values { "string" string } { "strings" sequence } }
33 { $description "Split the given string on whitespace." } ;
36 { $values { "line" string } }
37 { $description "Process a line from a material file within the current parsing context." } ;
40 { $values { "file" pathname } { "material-dictionary" assoc } }
41 { $description "Read the specified material file and generate a material dictionary keyed by material name." } ;
43 HELP: obj-vertex-format
44 { $class-description "Vertex format used for rendering OBJ geometry." } ;
47 { $values { "x" sequence } { "y" sequence } }
48 { $description "Convert a sequence of vertex, texture and normal indices into a sequence of vertex, texture and normal values." } ;
51 { $values { "x" sequence } { "y" sequence } { "z" sequence } }
52 { $description "Convert a sequence of vertex, texture and normal indices into two sequences of vertex, texture and normal values. This splits a quad into two triangles." } ;
55 { $values { "x" sequence } { "y" sequence } }
56 { $description "Convert a face line to a sequence of vertex attributes." } ;
59 { $values { "elt" object } { "seq" sequence } }
60 { $description "Push the value onto the sequence, keeping the sequence on the stack." } ;
62 HELP: push-current-model
63 { $description "Push the current model being built onto the models list and initialize a fresh empty model." } ;
66 { $values { "line" string } }
67 { $description "Process a line from the object file within the current parsing context." } ;