summaryrefslogtreecommitdiff
path: root/src/example/01_dot
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-12-21 22:24:15 +0800
committerchai <chaifix@163.com>2019-12-21 22:24:15 +0800
commitec111247c614663d8231245a17c314b9b8b4a28c (patch)
treea66058508161da488371c90316865ae850b8be15 /src/example/01_dot
parentc3f45735ecfab6e567be371758f21395e92dfef6 (diff)
*misc
Diffstat (limited to 'src/example/01_dot')
-rw-r--r--src/example/01_dot/01_dot.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/example/01_dot/01_dot.c b/src/example/01_dot/01_dot.c
new file mode 100644
index 0000000..e2902ca
--- /dev/null
+++ b/src/example/01_dot/01_dot.c
@@ -0,0 +1,36 @@
+#include "../example.h"
+#include "../../core/rasterizer.h"
+
+Vec3 pos = { 0, 0, 2 }, target = { 0,0,-1 }, up = { 0, 1, 0 };
+
+float dot[] = { 0, 0, -2 };
+
+void onloaddot(void* data) {
+
+}
+
+void oneventdot(void* data) {
+ SDL_Event* e = (SDL_Event*)data;
+}
+
+void onupdatedot(void*data) {
+ uint dt = *(uint*)data;
+ ssr_matrixmode(MATRIX_VIEW);
+ ssr_lookat(&pos, &target, &up);
+ ssr_matrixmode(MATRIX_PROJECTION);
+}
+
+float j = 0;
+
+void ondrawdot(void*data) {
+ ssr_clearcolor(0xffffffff);
+
+ //for (int i = -50; i < 200; ++i) {
+ // ssr_putpoint(i * sin(j += 0.1f), 300 * cos(j), ssr_color(0xff, 0, 0xff, 0));
+ //}
+
+ ssrR_putline(-100, 0, 100, 200, 0xffff0000);
+
+// printf("%u\n", (UINT_MAX * (double)0.5F));
+
+}