Fixing adsoda docs
parent
b9a5183b42
commit
a622d6113e
extra/adsoda
|
@ -1,23 +1,19 @@
|
||||||
! Copyright (C) 2008 Jeff Bigot
|
! Copyright (C) 2008 Jeff Bigot
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: help.markup help.syntax ;
|
USING: help.markup help.syntax multiline ;
|
||||||
|
|
||||||
IN: adsoda
|
IN: adsoda
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
! --------------------------------------------------------------
|
! --------------------------------------------------------------
|
||||||
! faces
|
! faces
|
||||||
! --------------------------------------------------------------
|
! --------------------------------------------------------------
|
||||||
ARTICLE: "face-page" "Face in ADSODA"
|
ARTICLE: "face-page" "Face in ADSODA"
|
||||||
"explanation of faces"
|
"explanation of faces"
|
||||||
$nl
|
$nl
|
||||||
"link to functions"
|
"link to functions" $nl
|
||||||
"what is an halfspace"
|
"what is an halfspace" $nl
|
||||||
"halfspace touching-corners adjacent-faces"
|
"halfspace touching-corners adjacent-faces" $nl
|
||||||
"touching-corners list of pointers to the corners which touch this face\n"
|
"touching-corners list of pointers to the corners which touch this face" $nl
|
||||||
|
"adjacent-faces list of pointers to the faces which touch this face"
|
||||||
"adjacent-faces list of pointers to the faces which touch this face\n"
|
|
||||||
{ $subsection face }
|
{ $subsection face }
|
||||||
{ $subsection <face> }
|
{ $subsection <face> }
|
||||||
"test relative position"
|
"test relative position"
|
||||||
|
@ -244,31 +240,27 @@ $nl
|
||||||
;
|
;
|
||||||
|
|
||||||
ARTICLE: { "adsoda" "light" } "ADSODA : lights"
|
ARTICLE: { "adsoda" "light" } "ADSODA : lights"
|
||||||
"! HELP: light position color"
|
{ $code <"
|
||||||
"! <light> ( -- tuple ) light new ;"
|
! HELP: light position color
|
||||||
|
! <light> ( -- tuple ) light new ;
|
||||||
"! light est un vecteur avec 3 variables pour les couleurs\n"
|
! light est un vecteur avec 3 variables pour les couleurs\n
|
||||||
|
void Light::Apply(Vector& normal, double &cRed, double &cGreen, double &cBlue)\n
|
||||||
" void Light::Apply(Vector& normal, double &cRed, double &cGreen, double &cBlue)\n"
|
{ \n
|
||||||
" { \n"
|
// Dot the light direction with the normalized normal of Face.
|
||||||
" // Dot the light direction with the normalized normal of Face."
|
register double intensity = -(normal * (*this));
|
||||||
" register double intensity = -(normal * (*this));"
|
// Face is a backface, from light's perspective
|
||||||
|
if (intensity < 0)
|
||||||
" // Face is a backface, from light's perspective"
|
return;
|
||||||
" if (intensity < 0)"
|
|
||||||
" return;"
|
// Add the intensity componentwise
|
||||||
" "
|
cRed += red * intensity;
|
||||||
" // Add the intensity componentwise"
|
cGreen += green * intensity;
|
||||||
" cRed += red * intensity;"
|
cBlue += blue * intensity;
|
||||||
" cGreen += green * intensity;"
|
// Clip to unit range
|
||||||
" cBlue += blue * intensity;"
|
if (cRed > 1.0) cRed = 1.0;
|
||||||
|
if (cGreen > 1.0) cGreen = 1.0;
|
||||||
" // Clip to unit range"
|
if (cBlue > 1.0) cBlue = 1.0;
|
||||||
" if (cRed > 1.0) cRed = 1.0;"
|
"> }
|
||||||
" if (cGreen > 1.0) cGreen = 1.0;"
|
|
||||||
" if (cBlue > 1.0) cBlue = 1.0;"
|
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue