From c3f6a9a94575035b4226fc646989d561efe5c3f4 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 11 Mar 2018 00:10:38 -0500 Subject: update with spinning view --- redist/linmath.c | 1 + simple_pose_test.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/redist/linmath.c b/redist/linmath.c index 4240ed6..3cbe2cc 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -491,6 +491,7 @@ void quatrotatevector( FLT * vec3out, const FLT * quat, const FLT * vec3in ) vquat[3] = vec3in[2]; //XXX WARNING: This code is probably SLOW. See this: https://github.com/axlecrusher/hgengine3/blob/master/Mercury3/basic_light1_v.glsl + //See: http://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/ quatrotateabout( tquat, quat, vquat ); quatgetconjugate( qrecp, quat ); diff --git a/simple_pose_test.c b/simple_pose_test.c index 4b392b9..aef3de5 100644 --- a/simple_pose_test.c +++ b/simple_pose_test.c @@ -126,7 +126,7 @@ void *GUIThread(void*v) CNFGGetDimensions( &screenx, &screeny ); int x, y; - float eye[3] = { 8, 8, 8}; + float eye[3] = { sin(TimeSinceStart)*4, cos(TimeSinceStart)*4, 4}; float at[3] = { 0,0, 0 }; float up[3] = { 0,0, 1 }; @@ -141,6 +141,7 @@ void *GUIThread(void*v) tdLookAt( gSMatrix, eye, at, up ); CNFGColor( 0x00ffff ); DrawLineSegment( hpos[0], hpos[1], hpos[2], hpos2[0], hpos2[1], hpos2[2] ); + CNFGColor( 0xff00ff ); DrawLineSegment( hpos[0], hpos[1], hpos[2], hpos[0], hpos[1], hpos[2] ); CNFGColor( 0x0000ff ); DrawLineSegment( 0, 0, 0, 1, 0, 0 ); CNFGColor( 0xff0000 ); DrawLineSegment( 0, 0, 0, 0, 1, 0 ); CNFGColor( 0x00ff00 ); DrawLineSegment( 0, 0, 0, 0, 0, 1 ); -- cgit v1.2.3