Raylib 3D
- Posted by Icy_Viking Jul 11, 2019
- 1766 views
Hello,
So I recently tried making an example in 3D using the Euraylib wrapper I wrote. However I notice when it comes to camera functions, there's a little bit of things that might get a little iffy. I'm trying to make a Euphoria port of the 3D shapes example. However the camera C code is like this.
EDIT: I've added raymath functions to the raylib wrapper. I noticed they were included in the raylib.DLL when I used a program to view the functions in the DLL.
Camera camera = { 0 }; camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; camera.type = CAMERA_PERSPECTIVE;
include std/machine.e include std/convert.e include flags.e include Euraylib.ew atom width = 800 atom height = 600 InitWindow(width,height,"3D Stuff") atom Camera = 0 SetCameraMode(Camera,CAMERA_THIRD_PERSON) atom blue = bytes_to_int({0,0,255,255}) atom white = bytes_to_int({255,255,255,255}) SetTargetFPS(60) while not WindowShouldClose() do BeginDrawing() ClearBackground(white) BeginMode3D(Camera) UpdateCamera(Camera) --first are x,y,z positions, next are for width,height and scale, then the color DrawCube(-4.0,0.0,2.0,2.0,5.0,2.0,blue) EndMode3D() DrawFPS(1,1) EndDrawing() end while CloseWindow()
When it comes to Euphoria port, I'm not sure how I'd get around that camera stuff. There is no function for something like SetCameraPosition() in RayLib. If anyone has a workaround, that would be great.