]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/4DNav/camera/camera-docs.factor
tools.test: Make the flag public. Finish porting tester changes to fuzzer.
[factor.git] / unmaintained / 4DNav / camera / camera-docs.factor
1 ! Copyright (C) 2008 Jean-François Bigot.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel ;
4 IN: 4DNav.camera
5
6 HELP: camera-eye
7 { $values
8     
9      { "point" "position" }
10 }
11 { $description "return the position of the camera" } ;
12
13 HELP: camera-focus
14 { $values
15     
16      { "point" "position" }
17 }
18 { $description "return the point the camera looks at" } ;
19
20 HELP: camera-up
21 { $values
22     
23      { "dirvec" "upside direction" }
24 }
25 { $description "In order to precise the roling position of camera give an upward vector" } ;
26
27 HELP: do-look-at
28 { $values
29      { "camera" "direction" }
30 }
31 { $description "Word to use in replacement of gl-look-at when using a camera" } ;
32
33 ARTICLE: "4DNav.camera" "Camera"
34 { $vocab-link "4DNav.camera" }
35 $nl
36 "A camera is defined by:"
37 { $list
38 { "a position (" { $link camera-eye } ")" }
39 { "a focus direction (" { $link camera-focus } ")" }
40 { "an attitude information (" { $link camera-up } ")" }
41 }
42 "Use " { $link do-look-at } " in opengl statement in placement of gl-look-at"
43 $nl
44 "A camera is a " { $vocab-link "4DNav.turtle" } " object. Its a special vocab to handle mouvements of a 3D object:"
45 { $list
46 { "To define a camera"
47 {
48     $unchecked-example
49     
50 "VAR: my-camera"
51 ": init-my-camera ( -- )"
52 "    <turtle> >my-camera"
53 "    [ my-camera> >self"
54 "      reset-turtle "
55 "    ] with-scope ;"
56 } }
57 { "To move it"
58 {
59     $unchecked-example
60
61 "    [ my-camera> >self"
62 "      45 pitch-up "
63 "      5 step-turtle" 
64 "    ] with-scope "
65 } }
66 { "or"
67 {
68     $unchecked-example
69
70 "    [ my-camera> >self"
71 "      5 strafe-left"
72 "    ] with-scope "
73 }
74 }
75 {
76 "to use it in an opengl statement"
77 {
78     $unchecked-example
79   "my-camera> do-look-at"
80
81 }
82 }
83 }
84
85
86 ;
87
88 ABOUT: "4DNav.camera"