mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
dbf8647d59
Added top & right borders to RawDr. Improved spacing in some debug and compiler reporting. Fixed RawPutChar and EdLite tab width. Fixed Ui missing '0x' prefix syntax highlighter bug. Added 32BitPaint demo.
214 lines
24 KiB
HTML
Executable file
214 lines
24 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.08">
|
|
<style type="text/css">
|
|
body {background-color:#000000;}
|
|
.cF0{color:#ffffff;background-color:#000000;}
|
|
.cF1{color:#3465a4;background-color:#000000;}
|
|
.cF2{color:#4e9a06;background-color:#000000;}
|
|
.cF3{color:#06989a;background-color:#000000;}
|
|
.cF4{color:#a24444;background-color:#000000;}
|
|
.cF5{color:#75507b;background-color:#000000;}
|
|
.cF6{color:#ce982f;background-color:#000000;}
|
|
.cF7{color:#bcc0b9;background-color:#000000;}
|
|
.cF8{color:#555753;background-color:#000000;}
|
|
.cF9{color:#729fcf;background-color:#000000;}
|
|
.cFA{color:#82bc49;background-color:#000000;}
|
|
.cFB{color:#34e2e2;background-color:#000000;}
|
|
.cFC{color:#ac3535;background-color:#000000;}
|
|
.cFD{color:#ad7fa8;background-color:#000000;}
|
|
.cFE{color:#fce94f;background-color:#000000;}
|
|
.cFF{color:#000000;background-color:#000000;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF2>//"ls" is light source.</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></span><span class=cF1>U0</span><span class=cF0> Lighting(</span><span class=cF9>CDC</span><span class=cF0> *dc, </span><span class=cF9>CD3I32</span><span class=cF0> *ls, </span><span class=cF9>CD3I32</span><span class=cF0> *poly, </span><span class=cF9>I64</span><span class=cF0> color)
|
|
<a name="l4"></a>{</span><span class=cF2>//color is a color from 0-7</span><span class=cF0>
|
|
<a name="l5"></a> </span><span class=cF9>CD3I32</span><span class=cF0> v1, v2;
|
|
<a name="l6"></a> </span><span class=cF9>I64</span><span class=cF0> *r = dc->r, i, vn_x, vn_y, vn_z;
|
|
<a name="l7"></a> </span><span class=cF1>F64</span><span class=cF0> d;
|
|
<a name="l8"></a>
|
|
<a name="l9"></a> v1.x = poly[</span><span class=cFE>0</span><span class=cF0>].x - poly[</span><span class=cFE>1</span><span class=cF0>].x;
|
|
<a name="l10"></a> v1.y = poly[</span><span class=cFE>0</span><span class=cF0>].y - poly[</span><span class=cFE>1</span><span class=cF0>].y;
|
|
<a name="l11"></a> v1.z = poly[</span><span class=cFE>0</span><span class=cF0>].z - poly[</span><span class=cFE>1</span><span class=cF0>].z;
|
|
<a name="l12"></a>
|
|
<a name="l13"></a> v2.x = poly[</span><span class=cFE>2</span><span class=cF0>].x - poly[</span><span class=cFE>1</span><span class=cF0>].x;
|
|
<a name="l14"></a> v2.y = poly[</span><span class=cFE>2</span><span class=cF0>].y - poly[</span><span class=cFE>1</span><span class=cF0>].y;
|
|
<a name="l15"></a> v2.z = poly[</span><span class=cFE>2</span><span class=cF0>].z - poly[</span><span class=cFE>1</span><span class=cF0>].z;
|
|
<a name="l16"></a>
|
|
<a name="l17"></a> </span><span class=cF2>//V1 and V2 are vects along two sides</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF2>//of the polygon joined at point[1].</span><span class=cF0>
|
|
<a name="l19"></a>
|
|
<a name="l20"></a> vn_x = v1.y * v2.z - v1.z * v2.y;
|
|
<a name="l21"></a> vn_y = v1.z * v2.x - v1.x * v2.z;
|
|
<a name="l22"></a> vn_z = v1.x * v2.y - v1.y * v2.x;
|
|
<a name="l23"></a>
|
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (d = </span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>SqrI64</span><span class=cF0>(vn_x) + </span><span class=cF5>SqrI64</span><span class=cF0>(vn_y) + </span><span class=cF5>SqrI64</span><span class=cF0>(vn_z)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l25"></a> d = </span><span class=cFE>1</span><span class=cF0> << </span><span class=cFE>16</span><span class=cF0> / d;
|
|
<a name="l26"></a> vn_x *= d;
|
|
<a name="l27"></a> vn_y *= d;
|
|
<a name="l28"></a> vn_z *= d;
|
|
<a name="l29"></a> </span><span class=cF2>//Vn is the cross product of V1 and V3</span><span class=cF0>
|
|
<a name="l30"></a> </span><span class=cF2>//which means it is perpendicular. It</span><span class=cF0>
|
|
<a name="l31"></a> </span><span class=cF2>//is the normal vect to the surface.</span><span class=cF0>
|
|
<a name="l32"></a> </span><span class=cF2>//It has been scaled to length 65536.</span><span class=cF0>
|
|
<a name="l33"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r, &vn_x, &vn_y, &vn_z);
|
|
<a name="l34"></a> i = (vn_x * ls->x + vn_y * ls->y + vn_z * ls->z) >> </span><span class=cFE>16</span><span class=cF0>;
|
|
<a name="l35"></a> </span><span class=cF2>//The dot product of the light source</span><span class=cF0>
|
|
<a name="l36"></a> </span><span class=cF2>//vect and the surface normal</span><span class=cF0>
|
|
<a name="l37"></a> </span><span class=cF2>//gives an illumination number.</span><span class=cF0>
|
|
<a name="l38"></a>
|
|
<a name="l39"></a> </span><span class=cF2>//ZealOS will generate a random U16</span><span class=cF0>
|
|
<a name="l40"></a> </span><span class=cF2>//and compare to dither_probability_u16 and</span><span class=cF0>
|
|
<a name="l41"></a> </span><span class=cF2>//will pick from two colors.</span><span class=cF0>
|
|
<a name="l42"></a> </span><span class=cF2>//Probability dithering does not work with thick>1 at this time.</span><span class=cF0>
|
|
<a name="l43"></a> </span><span class=cF1>if</span><span class=cF0> (i < </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l44"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l45"></a> dc->color = </span><span class=cF3>ROPF_PROBABILITY_DITHER</span><span class=cF0> + </span><span class=cF3>BLACK</span><span class=cF0> << </span><span class=cFE>16</span><span class=cF0> + color;
|
|
<a name="l46"></a> dc->dither_probability_u16 = -i;
|
|
<a name="l47"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l48"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l49"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l50"></a> dc->color = </span><span class=cF3>ROPF_PROBABILITY_DITHER</span><span class=cF0> + (color ^ </span><span class=cFE>8</span><span class=cF0>) << </span><span class=cFE>16</span><span class=cF0> + color;
|
|
<a name="l51"></a> dc->dither_probability_u16 = i;
|
|
<a name="l52"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l53"></a>}
|
|
<a name="l54"></a>
|
|
<a name="l55"></a>#</span><span class=cF1>define</span><span class=cF0> RINGS </span><span class=cFE>8</span><span class=cF0>
|
|
<a name="l56"></a>#</span><span class=cF1>define</span><span class=cF0> FACES </span><span class=cFE>32</span><span class=cF0>
|
|
<a name="l57"></a>#</span><span class=cF1>define</span><span class=cF0> SLOP </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>03</span><span class=cF0> </span><span class=cF2>//Gaps appear without this.</span><span class=cF0>
|
|
<a name="l58"></a>
|
|
<a name="l59"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DrawIt</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>CDC</span><span class=cF0> *dc)
|
|
<a name="l60"></a>{
|
|
<a name="l61"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c = </span><span class=cF5>CtrlFindUnique</span><span class=cF0>(task, </span><span class=cF3>CTRLT_VIEWING_ANGLES</span><span class=cF0>);
|
|
<a name="l62"></a> </span><span class=cF9>CViewAngles</span><span class=cF0> *s = c->state;
|
|
<a name="l63"></a> </span><span class=cF1>F64</span><span class=cF0> tt = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>5</span><span class=cF0> * (</span><span class=cF5>Sin</span><span class=cF7>(</span><span class=cF3>pi</span><span class=cF0> * </span><span class=cFE>2</span><span class=cF0> * (</span><span class=cF5>tS</span><span class=cF0> % </span><span class=cFE>10</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>) / </span><span class=cFE>10</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>),
|
|
<a name="l64"></a> theta, theta2, phi, phi2, radius, d;
|
|
<a name="l65"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, cx = task->pix_width / </span><span class=cFE>2</span><span class=cF0>, cy = task->pix_height / </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l66"></a> </span><span class=cF9>CD3I32</span><span class=cF0> poly[</span><span class=cFE>3</span><span class=cF0>], ls;
|
|
<a name="l67"></a>
|
|
<a name="l68"></a> dc->flags |= </span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
|
<a name="l69"></a> </span><span class=cF5>DCDepthBufAlloc</span><span class=cF0>(dc);
|
|
<a name="l70"></a>
|
|
<a name="l71"></a> </span><span class=cF5>Mat4x4IdentEqu</span><span class=cF0>(dc->r);
|
|
<a name="l72"></a> </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(dc->r, s->az);
|
|
<a name="l73"></a> </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(dc->r, s->ay);
|
|
<a name="l74"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(dc->r, s->ax + </span><span class=cF3>pi</span><span class=cF0>);
|
|
<a name="l75"></a> </span><span class=cF5>Mat4x4Scale</span><span class=cF0>(dc->r, tt);
|
|
<a name="l76"></a> </span><span class=cF5>DCMat4x4Set</span><span class=cF0>(dc, dc->r);
|
|
<a name="l77"></a>
|
|
<a name="l78"></a> ls.x = -(</span><span class=cFB>mouse</span><span class=cF0>.pos.x - task->pix_left - task->scroll_x - cx);
|
|
<a name="l79"></a> ls.y = -(</span><span class=cFB>mouse</span><span class=cF0>.pos.y - task->pix_top - task->scroll_y - cy);
|
|
<a name="l80"></a> ls.z = </span><span class=cF3>GR_WIDTH</span><span class=cF0> / </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l81"></a> d = </span><span class=cFE>1</span><span class=cF0> << </span><span class=cFE>16</span><span class=cF0> / </span><span class=cF5>D3I32Norm</span><span class=cF0>(&ls);
|
|
<a name="l82"></a> ls.x *= d;
|
|
<a name="l83"></a> ls.y *= d;
|
|
<a name="l84"></a> ls.z *= d;
|
|
<a name="l85"></a>
|
|
<a name="l86"></a> dc->x = cx;
|
|
<a name="l87"></a> dc->y = cy;
|
|
<a name="l88"></a> dc->z = </span><span class=cF5>MaxI64</span><span class=cF0>(cx, cy);
|
|
<a name="l89"></a> radius = </span><span class=cF5>MinI64</span><span class=cF0>(cx, cy) / </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l90"></a>
|
|
<a name="l91"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < RINGS; i++)
|
|
<a name="l92"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l93"></a> phi = i * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> / RINGS;
|
|
<a name="l94"></a> phi2 = (i + </span><span class=cFE>1</span><span class=cF0>) * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> / RINGS + SLOP;
|
|
<a name="l95"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j < FACES; j++)
|
|
<a name="l96"></a> {
|
|
<a name="l97"></a> theta = j * </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> /FACES;
|
|
<a name="l98"></a> theta2 = (j + </span><span class=cFE>1</span><span class=cF0>) * </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES + SLOP;
|
|
<a name="l99"></a>
|
|
<a name="l100"></a> </span><span class=cF2>//Upper half</span><span class=cF0>
|
|
<a name="l101"></a> poly[</span><span class=cFE>0</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta);
|
|
<a name="l102"></a> poly[</span><span class=cFE>0</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta);
|
|
<a name="l103"></a> poly[</span><span class=cFE>0</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l104"></a> poly[</span><span class=cFE>1</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta2);
|
|
<a name="l105"></a> poly[</span><span class=cFE>1</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta2);
|
|
<a name="l106"></a> poly[</span><span class=cFE>1</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l107"></a> poly[</span><span class=cFE>2</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l108"></a> poly[</span><span class=cFE>2</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l109"></a> poly[</span><span class=cFE>2</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l110"></a> Lighting(dc, &ls, poly, </span><span class=cF3>BLUE</span><span class=cF0>);
|
|
<a name="l111"></a> </span><span class=cF5>GrFillPoly3</span><span class=cF0>(dc, </span><span class=cFE>3</span><span class=cF0>, poly);
|
|
<a name="l112"></a>
|
|
<a name="l113"></a> poly[</span><span class=cFE>2</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l114"></a> poly[</span><span class=cFE>2</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l115"></a> poly[</span><span class=cFE>2</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l116"></a> poly[</span><span class=cFE>1</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta2 + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l117"></a> poly[</span><span class=cFE>1</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta2 + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l118"></a> poly[</span><span class=cFE>1</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l119"></a> poly[</span><span class=cFE>0</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta2);
|
|
<a name="l120"></a> poly[</span><span class=cFE>0</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta2);
|
|
<a name="l121"></a> poly[</span><span class=cFE>0</span><span class=cF0>].z = radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l122"></a> Lighting(dc, &ls, poly, </span><span class=cF3>BLUE</span><span class=cF0>);
|
|
<a name="l123"></a> </span><span class=cF5>GrFillPoly3</span><span class=cF0>(dc, </span><span class=cFE>3</span><span class=cF0>, poly);
|
|
<a name="l124"></a>
|
|
<a name="l125"></a> </span><span class=cF2>//Lower half</span><span class=cF0>
|
|
<a name="l126"></a> poly[</span><span class=cFE>2</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta);
|
|
<a name="l127"></a> poly[</span><span class=cFE>2</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta);
|
|
<a name="l128"></a> poly[</span><span class=cFE>2</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l129"></a> poly[</span><span class=cFE>1</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta2);
|
|
<a name="l130"></a> poly[</span><span class=cFE>1</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta2);
|
|
<a name="l131"></a> poly[</span><span class=cFE>1</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l132"></a> poly[</span><span class=cFE>0</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l133"></a> poly[</span><span class=cFE>0</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l134"></a> poly[</span><span class=cFE>0</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l135"></a> Lighting(dc, &ls, poly, </span><span class=cF3>RED</span><span class=cF0>);
|
|
<a name="l136"></a> </span><span class=cF5>GrFillPoly3</span><span class=cF0>(dc, </span><span class=cFE>3</span><span class=cF0>, poly);
|
|
<a name="l137"></a>
|
|
<a name="l138"></a> poly[</span><span class=cFE>0</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l139"></a> poly[</span><span class=cFE>0</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l140"></a> poly[</span><span class=cFE>0</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l141"></a> poly[</span><span class=cFE>1</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Cos</span><span class=cF0>(theta2 + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l142"></a> poly[</span><span class=cFE>1</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi2) * </span><span class=cF5>Sin</span><span class=cF0>(theta2 + </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / FACES / </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l143"></a> poly[</span><span class=cFE>1</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi2);
|
|
<a name="l144"></a> poly[</span><span class=cFE>2</span><span class=cF0>].x = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Cos</span><span class=cF0>(theta2);
|
|
<a name="l145"></a> poly[</span><span class=cFE>2</span><span class=cF0>].y = radius * </span><span class=cF5>Cos</span><span class=cF0>(phi) * </span><span class=cF5>Sin</span><span class=cF0>(theta2);
|
|
<a name="l146"></a> poly[</span><span class=cFE>2</span><span class=cF0>].z = -radius * </span><span class=cF5>Sin</span><span class=cF0>(phi);
|
|
<a name="l147"></a> Lighting(dc, &ls, poly, </span><span class=cF3>RED</span><span class=cF0>);
|
|
<a name="l148"></a> </span><span class=cF5>GrFillPoly3</span><span class=cF0>(dc, </span><span class=cFE>3</span><span class=cF0>, poly);
|
|
<a name="l149"></a> }
|
|
<a name="l150"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l151"></a>}
|
|
<a name="l152"></a>
|
|
<a name="l153"></a></span><span class=cF2>//See </span><a href="https://tomawezome.github.io/ZealOS/Demo/Graphics/SpritePlot3D.CC.html#l1"><span class=cF4>::/Demo/Graphics/SpritePlot3D.CC</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l154"></a></span><span class=cF2>//for a CSprite example.</span><span class=cF0>
|
|
<a name="l155"></a>
|
|
<a name="l156"></a></span><span class=cF2>//See </span><a href="https://tomawezome.github.io/ZealOS/System/Gr/SpriteMesh.CC.html#l1103"><span class=cF4>SpriteMeshEd</span></a><span class=cF2>() for a fancy example.</span><span class=cF0>
|
|
<a name="l157"></a>
|
|
<a name="l158"></a></span><span class=cF1>U0</span><span class=cF0> Main()
|
|
<a name="l159"></a>{
|
|
<a name="l160"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c = </span><span class=cF5>ViewAnglesNew</span><span class=cF0>;
|
|
<a name="l161"></a> </span><span class=cF9>CViewAngles</span><span class=cF0> *s = c->state;
|
|
<a name="l162"></a>
|
|
<a name="l163"></a> s->sx = </span><span class=cFE>2</span><span class=cF0> * </span><span class=cF3>VIEWANGLES_SNAP</span><span class=cF0>;
|
|
<a name="l164"></a> s->sy = </span><span class=cFE>7</span><span class=cF0> * </span><span class=cF3>VIEWANGLES_SNAP</span><span class=cF0>;
|
|
<a name="l165"></a> s->sz = </span><span class=cFE>6</span><span class=cF0> * </span><span class=cF3>VIEWANGLES_SNAP</span><span class=cF0>;
|
|
<a name="l166"></a>
|
|
<a name="l167"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="https://tomawezome.github.io/ZealOS/System/TaskSettings.CC.html#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
|
<a name="l168"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
|
|
<a name="l169"></a> </span><span class=cF5>WinBorder</span><span class=cF0>;
|
|
<a name="l170"></a> </span><span class=cF5>WinMax</span><span class=cF0>;
|
|
<a name="l171"></a> </span><span class=cF5>DocClear</span><span class=cF0>;
|
|
<a name="l172"></a> </span><span class=cF5>Fs</span><span class=cF0>->draw_it = &</span><span class=cF5>DrawIt</span><span class=cF0>;
|
|
<a name="l173"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l174"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l175"></a> </span><span class=cF6>"\n\nMove mouse to change light source.\n\n"</span><span class=cF0>;
|
|
<a name="l176"></a> </span><span class=cF5>PressAKey</span><span class=cF0>;
|
|
<a name="l177"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l178"></a> </span><span class=cF1>catch</span><span class=cF0>
|
|
<a name="l179"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l180"></a> </span><span class=cF5>DocClear</span><span class=cF0>;
|
|
<a name="l181"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
|
<a name="l182"></a> </span><span class=cF5>ViewAnglesDel</span><span class=cF0>;
|
|
<a name="l183"></a>}
|
|
<a name="l184"></a>
|
|
<a name="l185"></a>Main;
|
|
</span></pre></body>
|
|
</html>
|