getting ready to have the camera poses plotted using spheres. auto-copy pthreadVC3d.dll and poses.csv to output directory

This commit is contained in:
2025-08-21 13:19:42 -05:00
parent 1c4493a509
commit 8b816f8296
5 changed files with 23 additions and 1 deletions

View File

@@ -118,6 +118,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ext\pthreads4w-code\build\Debug\pthreadVC3d.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y "$(SolutionDir)poses.csv" "$(OutDir)" &amp;&amp; xcopy /y "$(SolutionDir)ext\pthreads4w-code\build\Debug\pthreadVC3d.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>

View File

@@ -6,6 +6,7 @@
struct body {
glm::mat4 pose;
float scale;
uint ebo;
uint vao;
uint vbo;

15
poses.csv Normal file
View File

@@ -0,0 +1,15 @@
x,y,z,w,i,j,k
266.74169921875, 160.65499877929688, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 160.65499877929688, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 447.67498779296875, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 447.67498779296875, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 734.6950073242188, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 734.6950073242188, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 1021.7150268554688, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 1021.7150268554688, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 1308.7349853515625, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 1308.7349853515625, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 1595.7550048828125, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 1595.7550048828125, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
266.74169921875, 1882.7750244140625, 138.2093963623047, 0.984807753012209, 3.512142734218295e-17, -0.17364817766692506, -5.0158596452676065e-17
-266.7416687011719, 1882.7750244140625, 138.2093963623047, 0.9848077530122087, 8.863269777109884e-16, 0.17364817766692614, 1.5628335990023316e-16
1 x y z w i j k
2 266.74169921875 160.65499877929688 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
3 -266.7416687011719 160.65499877929688 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
4 266.74169921875 447.67498779296875 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
5 -266.7416687011719 447.67498779296875 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
6 266.74169921875 734.6950073242188 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
7 -266.7416687011719 734.6950073242188 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
8 266.74169921875 1021.7150268554688 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
9 -266.7416687011719 1021.7150268554688 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
10 266.74169921875 1308.7349853515625 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
11 -266.7416687011719 1308.7349853515625 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
12 266.74169921875 1595.7550048828125 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
13 -266.7416687011719 1595.7550048828125 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16
14 266.74169921875 1882.7750244140625 138.2093963623047 0.984807753012209 3.512142734218295e-17 -0.17364817766692506 -5.0158596452676065e-17
15 -266.7416687011719 1882.7750244140625 138.2093963623047 0.9848077530122087 8.863269777109884e-16 0.17364817766692614 1.5628335990023316e-16

View File

@@ -101,6 +101,7 @@ bool load_body(body* out_body, const char* obj_filepath) {
glEnableVertexAttribArray(0);
*out_body = { .pose = glm::mat4(1),
.scale = 1.0f,
.ebo = ebo,
.vao = vao,
.vbo = vbo,

View File

@@ -31,9 +31,10 @@ void process_input() {
}
static uint shader;
void create_new_sphere(body* b) {
void create_new_sphere(body* b, float scale=1) {
assert(load_body(b, "Icosphere.obj"));
b->shader = shader;
b->scale = scale;
b->pose = glm::translate(b->pose, glm::vec3(0, 0, 0));
}
@@ -96,6 +97,7 @@ static void cursor_position_callback(GLFWwindow* window, double xpos, double ypo
float dy = (ypos - prev_cursor_y);
glm::mat4 camera_to_world = glm::inverse(world_to_camera);
// These could be acquired via some cross products. Don't know if that's more efficient.
glm::vec4 strafe_x = camera_to_world[0];
glm::vec4 strafe_y = camera_to_world[1];
prev_cursor_x = xpos;