Jump to content

  • Log In with Google      Sign In   
  • Create Account


What to learn to be able to create a 3rd person camera and terrain.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Zero_Breaker   Members   -  Reputation: 353

Like
0Likes
Like

Posted 17 January 2014 - 07:18 PM

Hi guys.

 

As i have decided to program 3D graphics for my game with OpenGL, i am suprisingly picking it up quite quickly and i do not see how i got confused before, i created a notebook for myself which includes quick and understandable notes about OpenGL and 3D Graphics, since i just started i know how to create a basic triangle and add some special shading effect's with GLSL to make it look better.

 

Aside from that, what do i need to learn to create a 3rd person camera? Does it involve matrix manipulation? Currently i want to create a point in space that is always on the player and the camera is focused on that point focusing on where that point is. I also want to create a one point so that i can switch camera angles for cutscenes and stuff like that. Here is a diagram of what i mean:

                                                                                         ---------------

                                                                                        |     ====     |

                                                                                        |     |   P  |     |

                                                                                        |     |       |     |

                                                                                        | X  ====      |

                                                                                        -----------------

Key:                             

X = Player

P = Point that the camera focuses on.

 

 

Also how would i create a terrain that is flat. I do not want to create a terrain that is lumpy because my game will be set in a City/Fururistic environement most of the time.

 

Any help would be highly appreciated.


Edited by Zero_Breaker, 17 January 2014 - 07:22 PM.


Sponsor:

#2 blueshogun96   Crossbones+   -  Reputation: 845

Like
2Likes
Like

Posted 17 January 2014 - 08:04 PM

There are multiple ways to do this.  I personally prefer the cheap and easy way of doing it.  Take a look at this tutorial written by swiftless: http://www.swiftless.com/tutorials/opengl/camera3.html

 

It uses legacy OpenGL (i.e. glTranslatef and glRotatef), but if you already have your own matrix rotation functions, you can easily replace the legacy/deprecated stuff.  

 

If you prefer a quaternion based camera, take a look at this tutorial by dhpoware: http://www.dhpoware.com/demos/glThirdPersonCamera1.html  (IIRC, it's quaternion based, at least the D3D version is).

 

Hope that helps.

 

Shogun.


Follow Shogun3D on the official website: http://shogun3d.net

 

blogger.png twitter.png tumblr_32.png facebook.png


#3 Zero_Breaker   Members   -  Reputation: 353

Like
0Likes
Like

Posted 17 January 2014 - 08:22 PM

Thank you very much for the resources. Just to say that i am pretty new to OpenGL and only know a little like using VBO's,VAO's and Shaders for a simple triangle. I just wanted to know the best most quickest and best way to implement a camera so that i can get an idea of how it work's. Thanks for the help though it was quite helpful.



#4 blueshogun96   Crossbones+   -  Reputation: 845

Like
0Likes
Like

Posted 17 January 2014 - 08:32 PM

My pleasure.  I had a rather hard time finding tutorials on 3rd person cameras a few years back.  Experimenting with rotation functions and searching google had me pounding my head on the nearest wall a few times.

 

Shogun.


Follow Shogun3D on the official website: http://shogun3d.net

 

blogger.png twitter.png tumblr_32.png facebook.png


#5 Zero_Breaker   Members   -  Reputation: 353

Like
0Likes
Like

Posted 17 January 2014 - 08:44 PM

Same with OpenGL, before i started i was confused and kept crashing with the code everywhere. I decided to try DirectX and it just was not for me and i noticed how much better i was being better off with OpenGL. What i did was go and look at some tutorials, look at the reference and I decided to make a bunch of notes about OpenGL and how it works and it helped me quite a lot to progress with OpenGL.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS