Tagged Questions
3
votes
1answer
102 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 ...
1
vote
0answers
59 views
Reconstructing Position from Linear Depth
In gBuffer (RGBA32F) I store a linear depth (camera space z position). Next I draw a full screen quad (two triangles) and I want
to reconstruct the position.
Vertex shader:
#version 420
...
2
votes
1answer
85 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
104 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
180 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
188 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
153 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
291 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, ...
2
votes
1answer
164 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 ...
2
votes
1answer
177 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
91 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
113 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 ...
12
votes
1answer
192 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
104 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
364 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
183 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
147 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
754 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
351 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
363 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
267 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
331 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
484 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
127 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
797 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
264 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
570 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
244 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 ...
1
vote
1answer
855 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
362 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 ...
3
votes
2answers
2k views
Basics of drawing in 2d with OpenGL 3 shaders
I am new to OpenGL 3 and graphics programming, and want to create some basic 2d graphics. I have the following scenario of how I might go about drawing a basic (but general) 2d rectangle. I'm not ...
2
votes
3answers
977 views
Suggest a simple Java math library for matrix operations for use with OpenGL (lwjgl) [closed]
I'm writing an OpenGL app with Java. I need to do some math for camera and frustum culling (for AABB). Could you suggest a simple and fast Java math library for that?
1
vote
2answers
282 views
Should SIMD be used by people who are new to game development?
I have been learning game development, using C++ and OpenGL, for about 4-5 months. Before that I used to program in C# and the .NET platform(about a year). So, I consider myself new to game ...
3
votes
1answer
819 views
Opengl-es picking object
I saw a lot of picking code opengl-es, but nothing worked. Can someone give me what am I missing?
My code is (from tutorials/forums)
Vec3 far = Camera.getPosition();
Vec3 near = ...
9
votes
1answer
248 views
Deforming surfaces
I try to accomplish an deforming physic behaviour for levelsurfaces, but don't get an idea how to start with the implemenation so far.
Regardless of the shape from the surface (planes, cubes, ...
4
votes
2answers
622 views
Ara matrices calculated on the GPU or on the CPU? Would built-in matrix functions be faster than my custom ones?
If I add a math library (for example containing a Matrix class) and use it in my program drawing with OpenGL, will my be work slower than if I used standard OpenGL functions for matrix calculations? ...
3
votes
1answer
954 views
Normal transformation and homogeneous coordinates
I'm very confused about the math behind the model/affine transformation expressed in homogeneous coordinates.
Reading this article, I understood that a generic vector is transformed by multiplying it ...
9
votes
1answer
2k views
How does UVW texture mapping work?
I'm trying to understand the mathematical theory behind UVW mapping. Can anyone explain me how UVW mapping works? Or at least provide me a pointer?
1
vote
2answers
406 views
OpenGL Camera causes spatial distortion
I'm trying to implement a 3D camera of the "Orbit around the origin" variety in a game engine I'm developing in order to learn about 3D graphics and game programming. I have a basic handle on the ...
1
vote
2answers
2k views
GLM: Quaternion SLERP Interpolation
I wish to interpolate two quaternion values. As I still can not get working results, can I kindly ask you to verify my function calls? The code below supports GLM (OpenGL Mathemathics) library, so ...
4
votes
4answers
3k views
GLM: Euler Angles to Quaternion
I hope you know GL Mathematics (GLM) because I've got a problem, I can not break:
I have a set of Eular Angles and I need to perform smooth interpolation between them. The best way is converting them ...
0
votes
2answers
648 views
How to generate a rotation matrix or a quaternion (properly rotated in regards to texture coordinates) for each triangle of a mesh?
I'm trying to build a uniform grid made of 3D points over the surface of an arbitrary mesh (we have texture-coordinates for each vertex...)
Or to reformulate: imagine a mesh textured with a texture ...
5
votes
1answer
4k views
OpenGL ES 2.0: Understanding Perspective Projection Matrix
Setting the Perspective projection matrix in Open GL (including OpenGL ES 2.0) has the following general format:
glm::mat4 perspective(float fovy, float aspect, float zNear, float zFar);
Notice the ...
3
votes
1answer
2k views
How to create a perspective field of view matrix?
Hey, hello. I am learning a little of WebGL (OpenGL ES 2.0) through the http://learningwebgl.com tutorials, but it uses a third party library to create the View, Projection and transformation matrices ...
4
votes
1answer
215 views
Projecting onto different size screens by cropping
I am building a phone application which will display a shape on screen. The shape should look the same on different screen sizes. I Decided the best way to do this is to show more of the background on ...
6
votes
1answer
1k views
Atmospheric Scattering
I'm trying to implement atmospheric scattering based on Sean O`Neil algorithm that was published in GPU Gems 2. But I have some trouble getting the shader to work. My latest attempts resulted in: ...
1
vote
1answer
329 views
Mandelbrot set not displaying properly
I am trying to render mandelbrot set using glsl. I'm not sure why its not rendering the correct shape. Does the mandelbrot calculation require values to be within a range for the (x,y) [ or (real, ...
12
votes
5answers
2k views
What is the purpose of the canonical view volume?
I'm currently learning OpenGL and haven't been able to find an answer to this question.
After the projection matrix is applied to the view space, the view space is "normalized" so that all the points ...
2
votes
1answer
433 views
Problem with arcball
I making graphics viewer, and I want to use "arcball" to manipulate object.
I using OpenGL + CML ( for math ). My arcball don't want work, it is skewing not rotating :/ And I don't know why, I use ...