0
votes
1answer
43 views

Geometry design and buffers

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do: Init: Stock array with positions, array with colors, array with ...
-1
votes
2answers
136 views

Using Geometric Slerp to move Camera

I'm writing a program in C++ using OpenGL and GLM; I'm trying to get my camera to follow my car. So far it successfully follows it around the screen, but I'm having trouble adjusting the Camera's ...
4
votes
3answers
1k views

How can I draw a quad in wireframe with modern OpenGL, without rendering the interior bisecting edge?

I want to draw a quad (not two triangles). I actually know that triangles are faster, as I answered this question. But let's say I am building a 3D modeling tool. It makes sense to draw a quad for ...
1
vote
0answers
301 views

Geometry shader and triangle adjacency

I'm currently trying to change my project to use GL_TRIANGLE_ADJACENCY instead of GL_TRIANGLES. Following this question, I have managed to construct my index buffer fine, but when it comes to the ...
2
votes
1answer
69 views

GL_TRIANGLE_ADJACENCY and glDrawElements

So I've not been able to find much online about how data should be stored for triangle adjacency. Currently I calculate my adjacent using half-edges (mention in an answer here). But do I store this ...
-5
votes
3answers
339 views

in the shadow of a sphere [duplicate]

(Related, but somewhat different, to my previous question) How can I determine in a fragment shader if a fragment is in the shadow of a sphere? That is, if it is occluded by the sphere and is past ...
3
votes
1answer
428 views

How do I render a filled and stroked path using OpenGL?

I want to render a 2-dimensional geometric path consisting of Bézier curves and straight lines. Paths can be concave. What is the most efficient way to draw this using modern OpenGL? Can I do this ...
1
vote
2answers
2k views

Rotate an object given only by its points?

I was recently writing a simple 3D maze FPP game. Once I was done fiddling with planes in OpenGL, I wanted to add support for importing Blender objects. The approach I used was triangulization of the ...
1
vote
2answers
1k views

Wrong faces culled in OpenGL when drawing a rectangular prism

I'm trying to learn opengl. I did some code for building a rectangular prism. I don't want to draw back faces so I used glCullFace(GL_BACK), glEnable(GL_CULL_FACE);. But I keep getting back faces also ...
1
vote
2answers
1k views

Render a polyline with rounded joints

I have a list of points (3D) and want to draw a line connecting all points with a specified width. The line should be rendered in OpenGL (using OSG) as triangles. The real challenge of this task is to ...
1
vote
1answer
315 views

How do I determine if a tile is a slope based on the tile image?

In my game, every tile is a 32x32 texture. All the slopes are a 0 - 45 degree angle. I would like to determine, at the time I load the tile, if the is sloped by examining its texture/bitmap data. How ...
4
votes
2answers
461 views

OpenGL, Offset and Camera Space

I was reading chapter 4 of the Arcsyntesis OpenGL tutorial when I came across this line in the GLSL shader. vec4 cameraPos = position + vec4(offset.x, offset.y, 0.0, 0.0); About it, the tutorial ...
2
votes
2answers
152 views

What is the purpose of glEdgeFlagv?

I know that what both glEdgeFlagv and glEdgeFlag do is toggle boundary edge status, but my question is why does the v version exist when the documentation specifies that the only difference is that ...
1
vote
1answer
1k views

what algorithms exist for combining multiple triangle meshes into one mesh

Let's say I have a terrain mesh of some triangles, and several smaller meshes which I want to add to that terrain mesh (think ground and some small mounds or berms for example). What would I look for ...
0
votes
2answers
825 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
2answers
1k views

Generating geometry when using VBO

Currently I am working on a project in which I generate geometry based on the players movement. A glorified very long trail, composed of quads. I am doing this by storing a STD::Vector, and removing ...
10
votes
2answers
9k views

converting a mouse click to a ray

I have a perspective projection. When the user clicks on the screen, I want to compute the ray between the near and far planes that projects from the mouse point, so I can do some ray intersection ...