SFML community forums

Help => Window => Topic started by: ezio160324 on July 15, 2014, 11:08:56 am

Title: First Person 3D Camera?
Post by: ezio160324 on July 15, 2014, 11:08:56 am
Hey. I'm wondering if anyone has made anything to help with a 3D first person camera. I saw sf3d but it's not for SFML 2.  :( Anyway, if nobody has done such a thing, can you give me some pointers on where to start?
Title: Re: First Person 3D Camera?
Post by: eXpl0it3r on July 15, 2014, 11:41:20 am
As soon as you want to go 3D with SFML, you'll have to start using OpenGL. If you don't know OpenGL yet, you should start learning it.

If you just want some simple 3D shapes, you could also look at binary1248's 3DEE fork (http://en.sfml-dev.org/forums/index.php?topic=14829.0).
Title: Re: First Person 3D Camera?
Post by: ezio160324 on July 15, 2014, 12:20:57 pm
Thanks. That should help until I get ready to do some real rendering. And yeah, I have learned a little OpenGL. I'm still learning.
Title: Re: First Person 3D Camera?
Post by: fallahn on July 15, 2014, 12:52:04 pm
I made a framework (https://github.com/fallahn/CHUF/tree/master/src/Mesh) based on SFML which supports first person camera via a 3D scene graph. It doesn't use very modern openGL, but you should be able to extract it from the 'mesh' folder (don't forget the headers in /include). There're no docs though, so you'll have to try and figure it out from the comments
Title: Re: First Person 3D Camera?
Post by: ezio160324 on July 15, 2014, 01:04:57 pm
I made a framework (https://github.com/fallahn/CHUF/tree/master/src/Mesh) based on SFML which supports first person camera via a 3D scene graph. It doesn't use very modern openGL, but you should be able to extract it from the 'mesh' folder (don't forget the headers in /include). There're no docs though, so you'll have to try and figure it out from the comments

Does it really require Box2D? Cuz I'm using Bullet for physics.  :-\
Title: Re: First Person 3D Camera?
Post by: fallahn on July 15, 2014, 01:46:01 pm
No, only if you plan to use the whole framework. Everything in the mesh folder should drop into another project, or compile as a lib
Title: Re: First Person 3D Camera?
Post by: ezio160324 on July 15, 2014, 01:52:37 pm
I see. I did try it, it didn't work. Could it be because I'm on Windows 8.1 using VS 2013?  :-[
Title: Re: First Person 3D Camera?
Post by: zsbzsb on July 15, 2014, 02:31:41 pm
I see. I did try it, it didn't work. Could it be because I'm on Windows 8.1 using VS 2013?  :-[

Like we can read your mind and figure out what the issue is.....
Title: Re: First Person 3D Camera?
Post by: fallahn on July 15, 2014, 02:38:02 pm
Could be any number of things, you'll have to scour the code thoroughly. I know it depends on glu and glm for one thing. If you can't find what you need in the code have you looked at this (https://github.com/binary1248/SFML)? It has added 3D support.
Title: Re: First Person 3D Camera?
Post by: ezio160324 on July 16, 2014, 02:27:06 pm
Could be any number of things, you'll have to scour the code thoroughly. I know it depends on glu and glm for one thing. If you can't find what you need in the code have you looked at this (https://github.com/binary1248/SFML)? It has added 3D support.

Wow, got it working. Thanks so much. Now to get to work on my skybox......

EDIT: Well, I'm trying to limit the vertical rotation. It's not working. I copied the camera code from the 3d.cpp file at the link.  :-\ I am at a loss.