Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5da6356
Rather than losing scenetrans and rotation, the scene matrix doesn't …
sebsjames Jul 16, 2025
84df36e
Prefer this order of operations
sebsjames Jul 16, 2025
9d960b9
Remove need for invscene member again
sebsjames Jul 17, 2025
bea845f
A nice improvement to rotations, now about centre of the window/works…
sebsjames Jul 17, 2025
0661e03
Brings sceneview computations into base class method and applies in b…
sebsjames Jul 17, 2025
459196e
An example useful for sceneview debugging
sebsjames Jul 18, 2025
2bf0e27
Progress to point where I realise that I think I do need to retain sc…
sebsjames Jul 18, 2025
fdbdc5b
Sceneview translation now goes via member mat44 sceneview
sebsjames Jul 18, 2025
48a4f23
Current (lack of) progres
sebsjames Jul 18, 2025
68ba500
More non progress
sebsjames Jul 18, 2025
fdfe155
Some progress. Rotate about screen centre is sort of working.
sebsjames Jul 21, 2025
5879100
More progress
sebsjames Jul 21, 2025
91c5a90
Fix rod_pan
sebsjames Jul 21, 2025
47a569d
Unify NoMX/MX
sebsjames Jul 21, 2025
14d3c35
cancels scrolling
sebsjames Jul 21, 2025
a681334
Sorts translation AND rotation in rotate about origin mode
sebsjames Jul 21, 2025
75c41ca
Pulls in latest maths
sebsjames Jul 21, 2025
c035996
Move to maths/main
sebsjames Jul 22, 2025
9184974
No need for these functions to return a mat44
sebsjames Jul 22, 2025
798192c
Sort 2D movements
sebsjames Jul 22, 2025
b21be78
Updated maths
sebsjames Jul 22, 2025
d7aebb4
Update maths
sebsjames Jul 23, 2025
5d2925e
Correct setting of sceneview and sceneview_tr for initial scene setup
sebsjames Jul 30, 2025
b752871
Lose scenetrans member attribute
sebsjames Jul 30, 2025
b35fd8e
Merge branch 'main' into dev/no_scene_member
sebsjames Jul 31, 2025
0dae98b
Keep existing rotate about origin behaviour before merge
sebsjames Jul 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ target_link_libraries(rhombo OpenGL::GL glfw Freetype::Freetype)
add_executable(rhombo_scene rhombo_scene.cpp)
target_link_libraries(rhombo_scene OpenGL::GL glfw Freetype::Freetype)

add_executable(rhombo_scene2 rhombo_scene2.cpp)
target_link_libraries(rhombo_scene2 OpenGL::GL glfw Freetype::Freetype)

add_executable(quads quads.cpp)
target_link_libraries(quads OpenGL::GL glfw Freetype::Freetype)

Expand Down
68 changes: 68 additions & 0 deletions examples/rhombo_scene2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// A scene of rhombohedrons useful for developing scene rotation by user control

#include <sm/vec>
#include <mplot/Visual.h>
#include <mplot/RhomboVisual.h>
#include <mplot/ColourMap.h>

int main()
{
// Create a scene
mplot::Visual v(1024, 768, "Rhombohedrons");
v.lightingEffects (true);

// Parameters of the model
sm::vec<float, 3> offset = { -1, 0, 0 }; // a within-scene offset
sm::vec<float, 3> e1 = { 0.25, 0, 0 };
sm::vec<float, 3> e2 = { 0.1, 0.25, 0 };
sm::vec<float, 3> e3 = { 0, 0.0, 0.25 };
mplot::ColourMap<float> cmap(mplot::ColourMapType::Rainbow);

// 0
offset = { 0, 0, 0 };
auto rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1/3, e2/3, e3/3, cmap.convert(0.1f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { -2, 0, 0 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(1.0f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { 2, 0, 0 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(0.5f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { 0, 2, 0 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(0.3333f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { 0, -2, 0 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(0.25f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { 0, 0, 2 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(0.2f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);

offset = { 0, 0, -2 };
rv = std::make_unique<mplot::RhomboVisual<>> (offset, e1, e2, e3, cmap.convert(0.1f));
v.bindmodel (rv);
rv->finalize();
v.addVisualModel (rv);
v.render();

v.keepOpen();

return 0;
}
Loading