SFML community forums

Help => General => Topic started by: GreyGoldFish on March 08, 2021, 02:39:43 pm

Title: 3D Model Projection in SFML
Post by: GreyGoldFish on March 08, 2021, 02:39:43 pm
Hey there! I'm a game developer, and I'm only getting started with SFML. I have experience with engines like Godot where you can project a 3D model into the 2D viewport, and I want to be able to do something similar in SFML for an isometric game.

I'm aware that SFML is 2D only, so would I have to necessarily use OpenGL to display a 3D model on a 2D plane? I looked around, and I couldn't find any answer that related exactly to what I want to accomplish, so here I am.

Thank you for reading, and I wish you all a lovely day/evening!
Title: Re: 3D Model Projection in SFML
Post by: fallahn on March 08, 2021, 02:49:43 pm
Broadly speaking it is possible to fudge 3D models with a sfml vertex array, some custom vertex shaders and the glm maths library - there's a proof of concept I came up with here: https://github.com/fallahn/osgc/tree/master/fist/src and a tool for converting models into vertex arrays here: https://github.com/fallahn/osgc/tree/master/lightmapper

If you're interested in how it works I don't mind explaining the concepts - but to be perfectly honest for the amount of work it takes you're better off just using OpenGL directly :)