Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
842 views

OpenGL C++ Camera Rotation Problem

Currently for a university assignment I have been given a 3D rendering engine, capable of rendering a 3D world. One task is to create a first person camera for it (I know with OpenGL you don't have a ...
1
vote
1answer
2k views

Creating vector shapes using only C++ [closed]

I've been researching for quite a while and I couldn't find any explanation or at least a how to create a vector graphic application (specifically in windows) where I can create a 3D vector shape, say ...
1
vote
0answers
199 views

Free 3D Scene Simulation Framework [closed]

I want to visualize a scene with simple shapes (e.g. boxes, pyramides, etc.) and I am looking for a tool or framework in C/C++ to do this. Focus of the application is to parameterize the relative ...
14
votes
1answer
9k views

Get vector length with GLM

I am quite confused over how GLM library is behaving or I am using it improperly. glm::vec2 testVec(6,-4); float len = testVec.length(); I get the value ...
6
votes
2answers
1k views

OpenGL with SFML, create an n-pointed star?

Completely stuck on how to do this. Yes, it is a homework problem, but its the first we've had in the class so not too familiar with graphics. Also, seeing as its homework, please don't just give the ...
5
votes
1answer
749 views

Type conversion to GL-types

If I have a std::vector<Foo> and want to store its size in a GLuint, my compiler gives a warning that there is possible ...
1
vote
0answers
99 views

Selecting pixels within a circle having a decimal (non integer) radius

I want to select a pixel within a circle of a certain radius. But the radius is expressed in a decimal form (0.12). What does it mean to have a radius equal to 0.12? And concretely how to pick a pixel ...
5
votes
1answer
160 views

How should I generate the view position for a light at infinity when creating depth maps?

I'm working on implementing Bruneton's cloud rendering paper, which requires one to render a pair of depth maps, similar to how shadow mapping works. In this case, my light source is the sun (or ...
4
votes
1answer
178 views

How to set the GLFW OpenGL target?

I'm programming on a Mac and I'm learning OpenGL in the library GLFW. My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with ...
4
votes
1answer
553 views

Angle between two points in Cartesian coordinate system C++

I'm trying to rotate a rectangle so that it faces another rectangle in a spiral. Im using the Bullet pyhics library and freeglut for the 3d application, for anyone interested https://github.com/...
8
votes
2answers
5k views

Archimedean spiral in C++

Im trying to plot the x and y positions of an Archimedean spiral in C++. So far I've been trying something like this, but no luck: ...
7
votes
1answer
599 views

The meaning of early ray termination and front-to-back traversal in ray tracing

I'm new to computer graphics. These days I've been trying to understand how ray tracing using an acceleration data structure works. I came across the term "early ray termination" several times, I ...
5
votes
1answer
1k views

Draw angles lines in raster graphics using bresenham line algorithm

I at the moment trying to draw some angled lines using bresenham line algorithm which can circulate a 2d array of size 21x21, as a line angled from 0 - 2pi. So the idea is that the program has to ...
2
votes
0answers
61 views

Draw lines angled from 0 to 2 pi in a raster grid [duplicate]

I am trying to draw an angled line in a raster grid. The idea is to create a function that given a start point, a length and an angle, would give me the pixel positions that combined would give me a ...
5
votes
1answer
944 views

Ray-triangle intersection algorithm not intersecting (C++)

I've been trying to implement the Moller-Trumbore ray-triangle intersection algorithm in my raytracing code. The code is supposed to read in a mesh and light sources, fire off rays from the light ...
6
votes
1answer
4k views

Shadow rays in Raytracing

After spending a few days making very little headway with a simple Raytracing program that implements Phong illumination (with shadows and no attenuation), I'm convinced I've made a logic error that I'...
7
votes
1answer
640 views

DirectX12 CbvHeap

With directX12 they introduced heap descriptors. A way for us to describe the table for resources we wanted to send to the shaders. I'm admittedly very new at computer graphics and only tinkered a bit ...
4
votes
1answer
3k views

DirectX 12 Constant Buffer Binding

I can't really seem to figure out how to bind two constant buffers to my shaders. I have them described like so. One in slot b0 and the other in slot b1. ...
13
votes
4answers
818 views

Projected grid water horizon detail

I'm trying to implement an ocean scene with C++ and DirectX11. Currently I have a projected grid, Gerstner waves and a basic shading. My problem is that when I aim my camera horizontally, so I can see ...
3
votes
1answer
175 views

First quad being re-used?

I had posted about this issue in a previous question, however, I thought instancing was causing it, whereas even using normal uniforms or a SSBO (which's what I'm using right now) causes it, which ...
4
votes
0answers
324 views

Incorrect instanced rendering

Previously, to render a bunch of quads, I was simply using a few uniforms (one for a model matrix and another for the texture layer ID). However, I'd rather not have to loop through each quad and set ...
4
votes
1answer
682 views

Dx12 Vertex Buffer incorrect

I'm playing around with directX 12 and I'm having some problems loading geometry in. I have a std::vector vertices definition and I do exactly what the dx12 template does with it. ...
4
votes
1answer
1k views

How to convert a thread ID into Screen Space Coord in an OpenGL Compute Shader?

I've written an implementation of the sphere tracing algorithm in OpenGL 4+. As an experiment/toy project, I'm re-implementing it using the OpenGL 4.3 compute shader, but I'm having trouble with the ...

1 2 3