mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
patterns/stl: Added 3D model visualization
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/core.pat>
|
||||
|
||||
struct Vector3f {
|
||||
float x, y, z;
|
||||
@@ -21,7 +22,7 @@ struct Triangle {
|
||||
} [[static]];
|
||||
|
||||
struct BinarySTLHeader {
|
||||
char caption[];
|
||||
char caption[while($[$] != 0x00 && $ - addressof(this) < 80)];
|
||||
padding[80 - sizeof(caption)];
|
||||
u32 triangleCount;
|
||||
};
|
||||
@@ -36,3 +37,15 @@ struct STL {
|
||||
};
|
||||
|
||||
STL stl @ 0x00;
|
||||
|
||||
/* Visualize the 3D Model */
|
||||
|
||||
struct Vertex {
|
||||
Vector3f points[3] @ addressof(stl.triangles[std::core::array_index()].points);
|
||||
};
|
||||
|
||||
struct Model {
|
||||
Vertex vertices[stl.header.triangleCount];
|
||||
} [[highlight_hidden, sealed, hex::visualize("3d", vertices, null)]];
|
||||
|
||||
Model model @ 0x00;
|
||||
|
||||
Reference in New Issue
Block a user