Compare commits

...

11 Commits

Author SHA1 Message Date
ff5f262883 test 2026-04-17 13:20:02 -05:00
534c25e1ca scale 2026-04-15 08:32:22 -05:00
b3a7cba102 scale 2026-04-15 08:28:05 -05:00
5aa8de36b7 add cubes 2026-04-15 08:21:44 -05:00
dd83699fd6 add cubes 2026-04-15 08:19:44 -05:00
5dbc3bf120 add cubes 2026-04-14 11:42:56 -05:00
984c86cf41 add cubes 2026-04-14 11:42:21 -05:00
3ac0a519e8 add cubes 2026-04-14 11:37:17 -05:00
70bf31ddbe update light direction 2026-04-14 10:03:08 -05:00
10c57dc347 update vertecies 2026-04-14 09:59:09 -05:00
959804b983 update flake 2026-04-11 07:01:04 -05:00
4 changed files with 230 additions and 186 deletions

36
flake.lock generated
View File

@@ -3,11 +3,11 @@
"clay": { "clay": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1767081147, "lastModified": 1775776254,
"narHash": "sha256-DbNZXjHAl2cmsWtDyw8BpW6dF7VoWHZ9EvQytSpqaKI=", "narHash": "sha256-qYg80qG7wed1SOJXzHIjeztVMBNxjP3w2E7D52U8njI=",
"owner": "nicbarker", "owner": "nicbarker",
"repo": "clay", "repo": "clay",
"rev": "76ec3632d80c145158136fd44db501448e7b17c4", "rev": "4c2c77886135a22f0a36e9afd9aa5b06c5e87734",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -21,11 +21,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1769996383, "lastModified": 1775087534,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381", "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -37,11 +37,11 @@
"imgui": { "imgui": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1770923283, "lastModified": 1775771252,
"narHash": "sha256-EOhlmnhoJRNjU7o7aCXnRrOw7JM0nq0VWDVnUJ6A6Xo=", "narHash": "sha256-PEfVSajjbWNHissISvh64ifiEJOP1g123DfVAuQqnLg=",
"owner": "ocornut", "owner": "ocornut",
"repo": "imgui", "repo": "imgui",
"rev": "3fb22b836ba968c62d280d9de079ec5ed7fcd1b5", "rev": "d55608a5bb8c8a6890957b9e216f969c9407265b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -53,11 +53,11 @@
}, },
"import-tree": { "import-tree": {
"locked": { "locked": {
"lastModified": 1771045967, "lastModified": 1773693634,
"narHash": "sha256-oYO4poyw0Sb/db2PigqugMlDwsvwLg6CSpFrMUWxA3Q=", "narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=",
"owner": "vic", "owner": "vic",
"repo": "import-tree", "repo": "import-tree",
"rev": "c968d3b54d12cf5d9c13f16f7c545a06c9d1fde6", "rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -68,11 +68,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770770419, "lastModified": 1775811116,
"narHash": "sha256-iKZMkr6Cm9JzWlRYW/VPoL0A9jVKtZYiU4zSrVeetIs=", "narHash": "sha256-t+HZK42pB6N+i5RGbuy7Xluez/VvWbembBdvzsc23Ss=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c5e707c6b5339359a9a9e215c5e66d6d802fd7a", "rev": "54170c54449ea4d6725efd30d719c5e505f1c10e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -84,11 +84,11 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1769909678, "lastModified": 1774748309,
"narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "72716169fe93074c333e8d0173151350670b824c", "rev": "333c4e0545a6da976206c74db8773a1645b5870a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -53,21 +53,7 @@ void Rubiks::onLoad() {
ImGui::SetCurrentContext(im->aquireContext()); ImGui::SetCurrentContext(im->aquireContext());
window->getRenderer()->clearColor = { 0, 0, 0, 1.0f }; window->getRenderer()->clearColor = { 0.2f, 0.2f, 0.2f, 1.0f };
cubeShader = Archimedes::Shader(cubeVS, cubeFS, Archimedes::Shader::LoadType::FromSource);
window->getRenderer()->setupShader(cubeShader);
cube = Archimedes::Body(
Archimedes::VertexBuffer(vertices),
Archimedes::IndexArray(indices),
layout,
cubeShader
);
window->getRenderer()->setupRenderTarget(cube.getMesh());
int w, h; int w, h;
window->getSize(w, h); window->getSize(w, h);
@@ -81,6 +67,8 @@ void Rubiks::onLoad() {
camera.setPerspective(glm::perspective(glm::radians(45.0f), (float)w/(float)h, 0.1f, 100.0f)); camera.setPerspective(glm::perspective(glm::radians(45.0f), (float)w/(float)h, 0.1f, 100.0f));
//camera.setPerspective(glm::ortho(-(float)w / 2.0f, (float)w / 2.0f, -(float)h / 2.0f, (float)h / 2.0f, 0.1f, 100.0f)); //camera.setPerspective(glm::ortho(-(float)w / 2.0f, (float)w / 2.0f, -(float)h / 2.0f, (float)h / 2.0f, 0.1f, 100.0f));
rubiksCube.init(window->getRenderer());
} }
void Rubiks::run() { void Rubiks::run() {
@@ -90,8 +78,8 @@ void Rubiks::run() {
static glm::vec3 pos(0), rot(0); static glm::vec3 pos(0), rot(0);
static glm::vec3 posPrev(0), rotPrev(0); static glm::vec3 posPrev(0), rotPrev(0);
static glm::vec3 camPos(0.0f, 0.0f, 3.0f), camRot(0.0f, glm::pi<float>(), 0.0f); static glm::vec3 camPos(0.0f, 0.0f, 10.0f), camRot(0.0f, glm::pi<float>(), 0.0f);
static glm::vec3 camPosPrev(0.0f, 0.0f, 3.0f), camRotPrev(0.0f, glm::pi<float>(), 0.0f); static glm::vec3 camPosPrev(0.0f, 0.0f, 10.0f), camRotPrev(0.0f, glm::pi<float>(), 0.0f);
static glm::vec4 color = { 0.4f, 3.0f, 0.4f, 1.0f }; static glm::vec4 color = { 0.4f, 3.0f, 0.4f, 1.0f };
@@ -109,13 +97,16 @@ void Rubiks::run() {
camPosPrev = camPos; camPosPrev = camPos;
camRotPrev = camRot; camRotPrev = camRot;
window->getRenderer()->draw( for(auto& b : rubiksCube.getBlocks()) {
cube.getMesh(), window->getRenderer()->draw(
cube.getTransform(), b.getMesh(),
camera.getTransform(), b.getTransform(),
camera.getPerspective(), camera.getTransform(),
color camera.getPerspective(),
); color
);
}
{ {
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
@@ -140,6 +131,18 @@ void Rubiks::run() {
ImGui::SliderFloat("cam y", &camPos.y, -10.0f, 10.0f); ImGui::SliderFloat("cam y", &camPos.y, -10.0f, 10.0f);
ImGui::SliderFloat("cam z", &camPos.z, -10.0f, 10.0f); ImGui::SliderFloat("cam z", &camPos.z, -10.0f, 10.0f);
ImGui::Text("Rubiks Cube Properties");
ImGui::SliderFloat("cube pitch", &rot.x, -glm::pi<float>(), glm::pi<float>());
ImGui::SliderFloat("cube yaw", &rot.y, 0, 2 * glm::pi<float>());
ImGui::SliderFloat("cube roll", &rot.z, -glm::pi<float>(), glm::pi<float>());
ImGui::SliderFloat("cube x", &pos.x, -10.0f, 10.0f);
ImGui::SliderFloat("cube y", &pos.y, -10.0f, 10.0f);
ImGui::SliderFloat("cube z", &pos.z, -10.0f, 10.0f);
ImGui::SliderFloat("cube scale", &scale, 0.01f, 10.0f);
if(ImGui::Button("Reset Window Size")) { if(ImGui::Button("Reset Window Size")) {
app->emitEvent(new Archimedes::ResizeWindowEvent(500, 500)); app->emitEvent(new Archimedes::ResizeWindowEvent(500, 500));
@@ -179,9 +182,8 @@ bool Rubiks::onEvent(const Archimedes::Event& e) {
Archimedes::ScrollWindowEvent event = (Archimedes::ScrollWindowEvent&) e; Archimedes::ScrollWindowEvent event = (Archimedes::ScrollWindowEvent&) e;
cube.rotateRel(glm::vec3(glm::pi<float>() * event.dy / 50.0f, 0.0f, 0.0f)); //camera.moveRel(glm::vec3(0.0f, 0.0f, event.dy));
cube.rotateRel(glm::vec3(0.0f, glm::pi<float>() * event.dx / 50.0f, 0.0f));
return true; return true;
} else if(type == app->getEventType(Archimedes::MouseMovedWindowEvent()) && !io.WantCaptureMouse) { } else if(type == app->getEventType(Archimedes::MouseMovedWindowEvent()) && !io.WantCaptureMouse) {

View File

@@ -1,7 +1,7 @@
// This only works with opengl!!!! // This only works with opengl!!!!
#ifndef JOBJECT_H #ifndef RUBIKS_H
#define JOBJECT_H #define RUBIKS_H
#include "Archimedes.h" #include "Archimedes.h"
@@ -11,6 +11,9 @@
#include "utils/Objects/Body.h" #include "utils/Objects/Body.h"
#include "utils/Objects/Camera.h" #include "utils/Objects/Camera.h"
#include "RubiksCube.h"
class Rubiks : public Archimedes::Module { class Rubiks : public Archimedes::Module {
public: public:
@@ -29,148 +32,12 @@ class Rubiks : public Archimedes::Module {
private: private:
Archimedes::Window* window; Archimedes::Window* window;
std::string cubeVS = "#version 430 core\n"
"layout (location = 0) in vec3 aPos;\n"
"layout (location = 1) in vec3 aNorm;\n"
"uniform mat4 model;\n"
"uniform mat4 view;\n"
"uniform mat4 proj;\n"
"uniform vec4 color;\n"
"out vec3 Norm;\n"
"out vec3 FragPos;\n"
"void main()\n"
"{\n"
" gl_Position = proj * view * model * vec4(aPos, 1.0f);\n"
" Norm = mat3(transpose(inverse(model))) * aNorm;\n"
" FragPos = vec3(model * vec4(aPos, 1.0f));\n"
"}\0";
std::string cubeFS = "#version 430 core\n"
"in vec3 Norm;\n"
"in vec3 FragPos;\n"
"out vec4 FragColor;\n"
"uniform mat4 model;\n"
"uniform mat4 view;\n"
"uniform mat4 proj;\n"
"uniform vec4 color;\n"
"void main()\n"
"{\n"
" vec3 light = vec3(1.0f, 1.0f, 1.0f);\n"
" vec3 amblight = 0.1f * light;\n"
" vec3 norm = normalize(Norm);\n"
" vec3 lightdir = normalize(vec3(-10, 20, 20) - FragPos);\n"
" vec3 diff = max(dot(norm, lightdir), 0.0) * light;\n"
" FragColor = vec4((amblight + diff) * color.rgb, 1.0f);\n"
"}\n\0";
Archimedes::Shader cubeShader;
Archimedes::Body cube;
Archimedes::VertexLayout layout = Archimedes::VertexLayout({
Archimedes::LayoutElement(Archimedes::LayoutElement::Type::Float, 3),
Archimedes::LayoutElement(Archimedes::LayoutElement::Type::Float, 3)
});
Archimedes::Camera camera; Archimedes::Camera camera;
std::vector<float> vertices = { RubiksCube rubiksCube;
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
-0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f
};
std::vector<unsigned int> indices = {
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
};
}; };
#ifdef SANDBOX_DYNAMIC #ifdef RUBIKS_DYNAMIC
typedef Rubiks mtype; typedef Rubiks mtype;
#include "endModule.h" #include "endModule.h"
#endif #endif

View File

@@ -0,0 +1,175 @@
// This only works with opengl!!!!
#ifndef RUBIKSCUBE_H
#define RUBIKSCUBE_H
#include "Archimedes.h"
#include "utils/Objects/Body.h"
#include "utils/Renderer/Renderer.h"
class RubiksCube {
public:
RubiksCube() {}
~RubiksCube() {}
void init(Archimedes::Renderer* r) {
shader = Archimedes::Shader(vs, fs, Archimedes::Shader::LoadType::FromSource);
r->setupShader(shader);
rt = Archimedes::RenderTarget(
Archimedes::VertexBuffer(vertices),
Archimedes::IndexArray(indices),
layout,
shader
);
r->setupRenderTarget(rt);
for(int i = 0; i < blocks.size(); i++) {
blocks.at(i) = Archimedes::Body(rt);
blocks.at(i).moveTo(positions.at(i));
blocks.at(i).scaleTo(0.1f);
}
}
std::vector<Archimedes::Body> getBlocks() { return blocks; }
private:
std::vector<Archimedes::Body> blocks = std::vector<Archimedes::Body>(26);
std::vector<glm::vec3> positions = {
glm::vec3(-1.0f, 1.0f, 1.0f), glm::vec3(0.0f, 1.0f, 1.0f), glm::vec3(1.0f, 1.0f, 1.0f),
glm::vec3(-1.0f, 1.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(1.0f, 1.0f, 0.0f),
glm::vec3(-1.0f, 1.0f, -1.0f), glm::vec3(0.0f, 1.0f, -1.0f), glm::vec3(1.0f, 1.0f, -1.0f),
glm::vec3(-1.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(1.0f, 0.0f, 1.0f),
glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec3(1.0f, 0.0f, 0.0f),
glm::vec3(-1.0f, 0.0f, -1.0f), glm::vec3(0.0f, 0.0f, -1.0f), glm::vec3(1.0f, 0.0f, -1.0f),
glm::vec3(-1.0f, -1.0f, 1.0f), glm::vec3(0.0f, -1.0f, 1.0f), glm::vec3(1.0f, -1.0f, 1.0f),
glm::vec3(-1.0f, -1.0f, 0.0f), glm::vec3(0.0f, -1.0f, 0.0f), glm::vec3(1.0f, -1.0f, 0.0f),
glm::vec3(-1.0f, -1.0f, -1.0f), glm::vec3(0.0f, -1.0f, -1.0f), glm::vec3(1.0f, -1.0f, -1.0f),
};
Archimedes::RenderTarget rt;
std::string vs = "#version 430 core\n"
"layout (location = 0) in vec3 aPos;\n"
"layout (location = 1) in vec3 aNorm;\n"
"layout (location = 2) in vec4 aCol;\n"
"uniform mat4 model;\n"
"uniform mat4 view;\n"
"uniform mat4 proj;\n"
"uniform vec4 color;\n"
"out vec3 Norm;\n"
"out vec3 FragPos;\n"
"out vec4 col;\n"
"void main()\n"
"{\n"
" gl_Position = proj * view * model * vec4(aPos, 1.0f);\n"
" Norm = mat3(transpose(inverse(model))) * aNorm;\n"
" FragPos = vec3(model * vec4(aPos, 1.0f));\n"
" col = aCol;\n"
"}\0";
std::string fs = "#version 430 core\n"
"in vec3 Norm;\n"
"in vec3 FragPos;\n"
"in vec4 col;\n"
"out vec4 FragColor;\n"
"uniform mat4 model;\n"
"uniform mat4 view;\n"
"uniform mat4 proj;\n"
"uniform vec4 color;\n"
"void main()\n"
"{\n"
" vec3 light = vec3(1.0f, 1.0f, 1.0f);\n"
" vec3 amblight = 0.1f * light;\n"
" vec3 norm = normalize(Norm);\n"
" vec3 lightdir = normalize(vec3(10, 20, 20) - FragPos);\n"
" vec3 diff = max(dot(norm, lightdir), 0.0) * light;\n"
" FragColor = vec4((amblight + diff) * col.rgb, 1.0f);\n"
"}\n\0";
Archimedes::Shader shader;
Archimedes::VertexLayout layout = Archimedes::VertexLayout({
Archimedes::LayoutElement(Archimedes::LayoutElement::Type::Float, 3),
Archimedes::LayoutElement(Archimedes::LayoutElement::Type::Float, 3),
Archimedes::LayoutElement(Archimedes::LayoutElement::Type::Float, 4)
});
std::vector<float> vertices = {
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 1.0f, //back
0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 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