Draw a rotating cube: Difference between revisions

m
→‎Zig: Update "works with". Simplify two lines involving casting and math.
m (→‎{{header|Wren}}: Changed to Wren S/H)
m (→‎Zig: Update "works with". Simplify two lines involving casting and math.)
 
Line 3,595:
=={{header|Zig}}==
{{libheader|Raylib}}
{{works with|Zig|0.11.0dev0}} {{works with|Raylib|4.6dev6}}
<syntaxhighlight lang="zig">const std = @import("std");
const c = @cImport({
Line 3,613:
const position = c.Vector3{ .x = 0, .y = 0, .z = 0 };
const x_rot = 45;
const y_center: f32 = std.math.sqrt(@as(f32, 3).0) * cube_side / 2.0;
const z_rot = std.math.radiansToDegrees(f32, std.math.atan(@as(f32, std.math.sqrt1_2)) * 180 / std.math.pi);
 
c.SetConfigFlags(c.FLAG_WINDOW_RESIZABLE | c.FLAG_VSYNC_HINT);
59

edits