help me
This commit is contained in:
parent
308a985519
commit
e3fe9136e5
|
@ -0,0 +1 @@
|
||||||
|
Rat model (assets/rat.obj): https://www.turbosquid.com/3d-models/maya-rat-games/611560
|
5
Makefile
5
Makefile
|
@ -1,7 +1,10 @@
|
||||||
CFLAGS +=
|
CFLAGS +=
|
||||||
LDFLAGS := -lm
|
LDFLAGS := -lraylib
|
||||||
OBJECTS :=
|
OBJECTS :=
|
||||||
|
|
||||||
|
run: cyber-rat
|
||||||
|
./cyber-rat
|
||||||
|
|
||||||
cyber-rat: lib
|
cyber-rat: lib
|
||||||
$(CC) $(CFLAGS) $(OBJECTS) src/main.c $(LDFLAGS) -o cyber-rat
|
$(CC) $(CFLAGS) $(OBJECTS) src/main.c $(LDFLAGS) -o cyber-rat
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
44
src/main.c
44
src/main.c
|
@ -1,6 +1,44 @@
|
||||||
#include <stdio.h>
|
// x-run: make -C.. clean run
|
||||||
#include <math.h>
|
#include <raylib.h>
|
||||||
|
#include <rlgl.h>
|
||||||
|
#include <raymath.h>
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
printf("Hi!\n");
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
||||||
|
InitWindow(800, 600, "c y b e r r a t");
|
||||||
|
SetTargetFPS(60);
|
||||||
|
|
||||||
|
Camera3D camera = {
|
||||||
|
.projection = CAMERA_PERSPECTIVE,
|
||||||
|
.fovy = 60.,
|
||||||
|
.position.x = 20.0,
|
||||||
|
.position.y = 20.0,
|
||||||
|
.position.z = 20.0,
|
||||||
|
.target.x = 0.0,
|
||||||
|
.target.y = 0.0,
|
||||||
|
.target.z = 0.0,
|
||||||
|
.up.x = 0.0,
|
||||||
|
.up.y = 1.0,
|
||||||
|
.up.z = 0.0,
|
||||||
|
};
|
||||||
|
|
||||||
|
SetCameraMode(camera, CAMERA_ORBITAL);
|
||||||
|
|
||||||
|
Model mod_rat = LoadModel("assets/rat.obj");
|
||||||
|
BoundingBox bbox_rat = GetModelBoundingBox(mod_rat);
|
||||||
|
|
||||||
|
for (int frame = 0; !WindowShouldClose(); frame++) {
|
||||||
|
UpdateCamera(&camera);
|
||||||
|
BeginDrawing();
|
||||||
|
{
|
||||||
|
ClearBackground(BLANK);
|
||||||
|
BeginMode3D(camera);
|
||||||
|
DrawGrid(10, 1.0);
|
||||||
|
rlDisableBackfaceCulling();
|
||||||
|
DrawModelWires(mod_rat, Vector3Zero(), 0.05, RED);
|
||||||
|
rlEnableBackfaceCulling();
|
||||||
|
EndMode3D();
|
||||||
|
}
|
||||||
|
EndDrawing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue