S
S
Stratimon2016-02-10 20:58:25
C++ / C#
Stratimon, 2016-02-10 20:58:25

OpenGl camera need help?

I know there are many topics. And Google has a lot of information. But still I decided to ask a question here.
So that's what I found
1) Move the world around the camera. Clearly understandable, but if the world is very large and saturated with many small objects. I don't think this is the best option.
2) Something like to calculate redraw and profit (this decision is poorly understood).
I did not find other options if they exist, please help. Preferably with verified links.
And another question. How is the camera made in DirectX?
Most likely, this is a stupid question and it appeared due to my meager knowledge, but I am very interested in the solution to this problem.
In general, I would like to know how this problem is implemented in online games MMO RPG
wow, pw, L2, etc.
I know they are on DirectX, but I'm interested in a solution in openGl solutions on DirectX are also suitable (I'm also interested in them).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2016-02-11
@Sratimon

First, let's agree that we don't distinguish between OpenGL and DirectX within the scope of the question. Let's call them "graphics API".
Secondly, we will consider this graphics API low-level (ie, such as OpenGL and DirectX). Graphic engines, where there is a concept of a scene and a camera, are not considered in principle.
So, with mathematics, you still have to deal with books (look for operations on matrices and vectors), so I'll try to suggest from a conceptual point of view.
The most important truth that you now need to understand:
For the graphics API, there are only primitives (triangles, lines, points) that you want to draw, consisting of vertices with 3D coordinates, and a set of mathematical transformations that you want to perform on those vertices BEFORE they are actually drawn on the screen (ie. e. before rasterizing them). ALL. Everything that looks to you like the movement / rotation of an object in the game world ("world transformations"), and the movement / rotation of the camera ("view transformations") is only the result of the fact that the vectors that define the vertices of the object (for example, a cube) are pre-multiplied to the desired matrix calculated by you.
About 10-15 years ago, such a matrix was given directly to the graphics API through special calls (when video users already knew how to do T&L https://en.wikipedia., but shaders haven't yet), today vector-matrix multiplication is just one of many different transformations that can be done in a vector shader .
Now read about how these matrices are used and calculated. When you understand the hardware, take a look at the GLM library (since you have C ++ and OpenGL specified) - it will help you not to do routine work.

R
RedHairOnMyHead, 2016-02-10
@ThePyzhov

OpenGL is a superbook, it talks about camera rotation through matrices.
PS For understanding you need a good mat. apparatus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question