Skip to content

Commit

Permalink
Starts to implement 3D model converter.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikskuh committed Aug 9, 2021
1 parent 1e487a4 commit fd545cb
Show file tree
Hide file tree
Showing 10 changed files with 1,177 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ pub fn build(b: *std.build.Builder) !void {
const mode = b.standardReleaseOptions();
const platform = sdk.standardPlatformOptions();

const converter = b.addExecutable("mconv", "tools/modelconv/main.zig");
converter.addCSourceFile("tools/modelconv/converter.cpp", &[_][]const u8{
"-std=c++17",
"-Wall",
"-Wextra",
});
converter.linkLibC();
converter.linkLibCpp();
converter.linkSystemLibrary("assimp");
converter.install();

const app = sdk.createApplication("demo_application", "examples/demo-application.zig");
app.setDisplayName("ZeroGraphics Demo");
app.setPackageName("net.random_projects.zero_graphics.demo");
Expand Down
1 change: 1 addition & 0 deletions examples/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.blend*
Binary file added examples/data/metal-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/data/metal-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/data/twocubes.blend
Binary file not shown.
24 changes: 24 additions & 0 deletions examples/data/twocubes.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Blender MTL File: 'twocubes.blend'
# Material Count: 2

newmtl Blue_Cube
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd metal-01.png

newmtl Red_Cube
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd metal-02.png
Loading

0 comments on commit fd545cb

Please sign in to comment.