3
votes
1answer
139 views

How to achieve cavalier projection using OpenGL fixed pipeline?

I want to make a quick demo program showing a cube, or a user loaded model, rotating in screen rendered with one of three projections: perspective, isometric and cavalier. Using the fixed pipeline, ...
2
votes
1answer
90 views

How do I check why is no output on screen?

I'm using OpenGL 3.3+, and I'm trying to create an orthographic projection to draw on screen. I have the model data in a buffer: X Y 0, 0 50, 100 100, 0 And I create my Model-View-Projection ...
2
votes
1answer
224 views

3D Camera Rotation

Please, forgive me, but I need help and I've been stuck on this for a few weeks now, I'm making no progress and everywhere I go and I see a different answer, everything I try doesn't work. I've had ...
0
votes
0answers
111 views

Alter a model-view-projection matrix

I have a model-view-projection matrix created based upon my camera. Is it possible to make alterations to it after it was computed to affect the corners of the resulting camera frustrum? For example, ...
1
vote
1answer
88 views

Floating point memory usage on gpu

My question is simple: how much memory on GPU does one floating point value takes? I guess it is 4 bytes, but I'm not sure. So for example is it true that vec4, which holds 4 floats, each 4 bytes ...
0
votes
1answer
669 views

Quaternion LookAt for camera

I am using the following code to rotate entities to look at points. glm::vec3 forwardVector = glm::normalize(point - position); float dot = glm::dot(glm::vec3(0.0f, 0.0f, 1.0f), forwardVector); ...
0
votes
2answers
157 views

Camera movement with slerp

I have 3 spots, I would like to move my camera to using slerp. Just As seen in the image below. My question is how I can connect my camera to the first spot? I should be able to move between other ...
1
vote
2answers
350 views

OpenGL position from depth is wrong

My engine is currently implemented using a deferred rendering technique, and today I decided to change it up a bit. First I was storing 5 textures as so: DEPTH24_STENCIL8 - Depth and stencil ...
3
votes
1answer
180 views

How to Construct a Perspective Projection With 4 Vanishing Points

Is it possible to construct a projection matrix which will create a perspective with four (or more) vanishing points? This question have an OpenGL tag, but general insights are welcomed as well.
0
votes
1answer
73 views

Displaying normals of a geometry

I have a rectangle which is created by 2 triangles and it is in x-z plane, and i have object on it. Now, the normals of two triangles (face normals) are y axis i.e. (0,1,0). I want to display normals ...
3
votes
1answer
110 views

Convert global rotation into local rotation

I have an object in my game and I have its location, rotation and scaling in separate float[3]. The location rotation and scale are all on the global axis; these do not change based on the objects ...
1
vote
1answer
451 views

Uncharted 2 tone mapping and an eye adaptation

I found an example of uncharted 2 tone mapping on this site. Here is the code: float A = 0.15; float B = 0.50; float C = 0.10; float D = 0.20; float E = 0.02; float F = 0.30; float W = 11.2; float3 ...
3
votes
4answers
281 views

How do I find the 2D direction to a 3D location?

I'm writing a 3D space flightsim, and I'm trying to display a 2D arrow on screen that points to the player's selected target. To clarify, the arrow needs to point in the direction that the player has ...
2
votes
1answer
1k views

Combining rotation,scaling around a pivot with translation into a matrix

In short: I need to combine rotation (in the form of a quaternion), scaling around a pivot point along with translation into a transformation matrix. The long: I am trying to implement a proprietary ...
1
vote
0answers
162 views

Rotate a point in 3D space with sine and cosine

I got my camera controlled by the mouse. Now I want a sphere to be always in the center of my view(just for testing). I tried that by assigning the sine of the Y rotation of the camera times 10 as the ...
0
votes
0answers
229 views

Space Strategy Ship Movement Math

This is similar to a question I asked a while ago, but I phrased it so terribly so might as well start over. I am trying to implement ship movement in 3D space, but confined to a 2D plane at y=0 (see ...
0
votes
1answer
102 views

Which is the right way to build a OpenGL Projection Matrix

This time I'm trying to learn the core of matrix transformations. I dont like the idea to using a Math library and dont understand what is hapening on background, because this I'm having some ...
0
votes
2answers
230 views

Is this Rotation Matrix correct?

I'm having heavly troubles with setting up a View Matrix and a Projection Matrix. It simply doesnt work. So I think my problem is related to my rotationMatrix function. I'm using this tutorial to ...
1
vote
2answers
654 views

Calculate object coordinates from window coordinates using inverse projection matrix

What I am trying to to is placing 3D Objects (A Sphere) in the world when I click there. I am using a perspective projection so the first step after calculating the canonical clip coordinates from ...
0
votes
1answer
304 views

Drawing the same scene with perspective then orthographic projections

I have a scene that I'm rendering first with a perspective matrix. I then want to rerender it in a different viewport using an orthographic matrix for a top-down 2D view of the scene. I think I may be ...
4
votes
1answer
675 views

Picking 3D with OpenGL ES 2

I'm trying to implement picking in my framework but I don't understand how I can do this. I'm working with: OpenGL ES 2. GLM mathematic library. What I have understand, picking can be made with ...
2
votes
1answer
325 views

RGB to xyY color space conversion and luminance

The luminance calculated by following GLSL functions (fragment shaders - tonemap) has different value: float GetLuminance (vec3 rgb) { return (0.2126 * rgb.x) + (0.7152 * rgb.y) + (0.0722 * ...
-1
votes
3answers
249 views

Directional light and matrix issues

I'm trying to implement basic directional lightning in OpenGL 3.3 by emulating the logic shown in this guide: http://www.arcsynthesis.org/gltut/Illumination/Tutorial%2009.html I do not understand ...
4
votes
1answer
655 views

deferred rendering and point light radius

I use a common attenuation equation for point lights: attenuation = 1 / kc + kl * d + kq * d^2. I use deferred rendering so I need to know a light radius. An example light has following intensity: ...
4
votes
2answers
460 views

Defining an OpenGL unit

I have read that you can define your OpenGL unit by using glViewport. As far as I understood if you use something like glViewport(0,0,600,600) then 1 OpenGL unit = 600 pixels. Now my problem is what ...
1
vote
1answer
426 views

Creating a frustum for culling in world-space glm matrices

I need to do frustum culling where the bounding boxes are in world-space to determine which entities get to be updated/drawn. I was trying to use the classic projection/view matrix plane extraction ...
2
votes
2answers
656 views

Bezier curve not drawn correctly

I'm trying to draw a bezier curve using 3 points. If I use the quadratic form: I get this result: And I believe it's correct. Now since I need to draw it with a variable number of points, ...
1
vote
1answer
508 views

How to rotate a direction

I'm working a spotlight for my deferred renderer and I'm having trouble with matching the mesh to the visual representation of the light. Right now my mesh is a cone, the apex of the cone is at ...
3
votes
1answer
333 views

How to do perspective projection “parallax” but without changing the scale or offset of objects?

Hello everyone I have this problem that I have tried everything I could think of. The problem: I am making a 2D game with parallax effect but I am using 3d space so am not simulating the parallax but ...
4
votes
1answer
107 views

What OpenCL video cards (or FPGAs) features are needed for high speed multiplication?

I'm benchmarking some cryptographic related software and am looking for video cards that are better at parallel multiplication vs parallel addition. Is there any prior work that would graph video ...
0
votes
1answer
209 views

Y Axis inverted on vertex output

I've got my project running and somehow it seems my vertex y components are inverted. 10 in the positive on Y goes down and 10 negative on the Y axis goes up. I can't find anything with the ...
13
votes
1answer
404 views

Orthographic unit translation mismatch on grid (e.g. 64 pixels translates incorrectly)

I am looking for some insight into a small problem with unit translations on a grid. Update and Solved I solved my own issue. See below for details. Everything in this part of the post turned out to ...
2
votes
2answers
128 views

setting the position in different resolution

I have a normal game window which is 640*480, and everything is fine, but when I try to maximize the window, the objects translate to different positions on the screen, for example If I have a circle ...
2
votes
2answers
834 views

Quaternion based rotation and pivot position

I can't figure out how to perform matrix rotation using Quaternion while taking into account pivot position in OpenGL.What I am currently getting is rotation of the object around some point in the ...
2
votes
3answers
326 views

How to adjust position relative to resolutions?

I have a lot of objects on the screen and would like at different resolutions, object's positions rendered correctly on the screen irrespective of the resolution. Is it correct to multiply the ...
1
vote
2answers
244 views

Billboarding + aligning with velocity direction

I'm working on a particle system where I'm orientating the billboard using the inverted orientation matrix of my camera. This works quite well and my quad are rotated correctly towards the camera. ...
0
votes
2answers
1k views

OpenGL matrix vs DirectX matrix

I'm working on an animation and model exporter from Maya to use within my game. Currently, models work perfectly, and animations have some issues with the joints. Since Maya works in an OpenGL ...
1
vote
0answers
62 views

obb vs obb and resolve/response for 2d space game [duplicate]

Possible Duplicate: OBB vs OBB Collision Detection How can i detect if an rotated obb intersects another rotated obb and resolve it so both obb objects dont go further into each other. I ...
0
votes
1answer
652 views

rotate opengl mesh relative to camera

I have a cube in opengl. It's position is determined by multiplying it's specific model matrix, the view matrix, and the projection matrix and then passing that to the shader as per this tutorial ...
2
votes
2answers
559 views

Rotating an object smoothly

I'm trying to rotate a ship in an asteroid game. What I'm doing is creating a float angle variable and at each time I press left or right buttons, I increase and decrease it, and in the drawing ...
1
vote
2answers
408 views

Aligning bullet's position in Asteroid Game

I'm writing an asteroid game and I would like to align the bullets on the ship's tip. I also want when the ship fires, the bullet gets the same orientation(angle, direction) of the ship and also be ...
0
votes
2answers
524 views

Asteroids Ship Movement

I have read source code of asteroids game. I want to know why when updating the ship's position in X, and Y Axis, we must write it in sin and cosine of the current angle. Is it angular velocity ? why ...
1
vote
2answers
783 views

Rotating a polygon around it's center

I have drawn a ship using three lines, and would like to rotate the ship around its axis in opengl, I have tried the following, but the ship translates while rotation!. void Ship::Draw( ) { ...
0
votes
1answer
153 views

Directional and orientation problem

I have drawn 5 tentacles which are shown in red. I have drew those tentacles on a 2D Circle, and positioned them on 5 vertices of the that circle. BTW, The circle is never be drawn, I have used it to ...
1
vote
1answer
1k views

Optimized algorithm for line-sphere intersection in GLSL

Well, hello then! I need to find intersection between line and sphere in GLSL. Right now my solution is based on Paul Bourke's page and was ported to GLSL this way: // The line passes through p1 and ...
-1
votes
1answer
375 views

Rotating points on a circle

I have drawn a 2D circle in X,Y,Z. I wanted to draw something on specific vertices of that circle and I managed to do it. When I wanted to move the circle, I wanted the vertices to get the updated ...
0
votes
1answer
792 views

Camera Rotation (for mouse look) with LookAt does not work as expected (Local/Global)

My code for rotating my 3D fps camera isn't working as expected. I expect that the X-axis does rotate with the Y-axis, but it ain't so. I made some pictures to explain it better, I think its doing ...
-3
votes
1answer
334 views

Getting the normals of a hemisphere?

I'm trying to calculate the normal for a hemisphere. I draw the hemi-sphere by this code: for(float phi = 0.0; phi < 1.567; phi += factor) { glBegin(GL_QUAD_STRIP); for(float ...
2
votes
1answer
1k views

Zooming to point of interest

I have the following variables: Point of interest which is the position(x,y) in pixels of the place to focus. Screen width,height which are the dimensions of the window. Zoom level which sets the ...
2
votes
2answers
462 views

3D Translation using only distance and angles

So I'm starting to foray into 3D game programming, but I've hit something of a snag. I have an object I want to move around. It should always move either forward or backward relative to its local Z ...