Most Popular

1500 questions
4
votes
2 answers

Bug with the Bresenham's line drawing algorithm?

I know how to draw lines with DDA, but I want to learn a more efficient way and Google suggests Bresenham's line drawing algorithm is better than DDA. Here is my implementation: int x0 = Math.round(m_start.getPosition().getX()); int y0 =…
user3437
4
votes
3 answers

Surface shading on an triangle

Let's assume that in a triangle we have computed the brightness on the vertices of a triangle and we have found that it is maximum. Can any other point which lies on that triangle have more brightness than the maximum brightness on those vertices ?
john john
  • 423
  • 1
  • 3
  • 9
4
votes
2 answers

Linear interpolation on Plane (Marching Cubes)

Let's assume I have the following cube. Let's assume the isovalue = 0. I would like to draw the resulting triangles of the isosurface. I know that first I define which values are inside or outside comparing them to the given isovalue and after that…
john john
  • 423
  • 1
  • 3
  • 9
4
votes
2 answers

2D projection from some points

I am going through an undocumented function that takes in three points and a Z-value that projects three points on the plane defined by Z-value. I want to understand the mathematical theory behind it and I need your help to decode the…
sajis997
  • 1,279
  • 1
  • 10
  • 15
4
votes
1 answer

Data fitting SVBRDF with L-M

I am reading two shot svbrdf capture . I want to understand the data fitting. For example, I have my input image 3000x2000 pixels, and I divide it to create my source tiles of 192x192 pixels. The way I understand this paper is, each pixel of each…
4
votes
0 answers

Linear gradient shader ( Photoshop-like)

I'm searching a way to implement a linear gradient shader that behaves as the linear gradient in Photoshop (only the vertical case is necessary). It will be applied to 2D sprites. Currently I'm passing to the pixel shader these…
enigma
  • 141
  • 1
4
votes
1 answer

Cohen-Sutherland Clipping

Specify individually the translation and scaling matrices required to transform a 2D window of [Xmin=-234, Ymin=156] and [Xmax=66, Ymax=456] to a display viewport of [Umin=45, Vmin=35] and [Umax=245, Vmax=185]. Ignore the question above since I…
TheRapture87
  • 181
  • 2
4
votes
1 answer

Optix: Rendering time-variant data

I have a Optix Raycasting renderer which loads and renders VTK files. For a single static model this works fine. But now my dataset consists of multiple timesteps which I want to display in a animated fashion. Each couple of frames or seconds the…
Dragonseel
  • 1,810
  • 1
  • 11
  • 24
4
votes
1 answer

How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)?

What I'm trying to do is to simulate refraction through biconcave lens described by spheres A, B, C where C is a sphere in between A and B. So far I've gathered that a good approach would be to use CSG when it comes to modeling such object. I'm…
niksbenik
  • 85
  • 1
  • 6
4
votes
1 answer

Data structure and algorithm for clipping triangulation with leaf nodes of an octree

I have an application in which I am using an octree to store a volume mesh of axis-aligned bounding boxes (AABBs). Given a water-tight manifold triangle mesh, I need to: find if an AABB is intersected by or completely inside/outside of the surface…
gnzlbg
  • 141
  • 3
4
votes
0 answers

Creating an Object Orientated Bounding Volume

I'm attempting to test out the maths behind bounding volume algorithms (prior to ray tracing) using MATLAB. So far, I have successfully created the relatively trivial axis aligned bounding volume, and I believe I have successfully created a bounding…
davidhood2
  • 243
  • 1
  • 11
4
votes
0 answers

Represent vector with arrow

Another code review question. I am trying to draw an arrow to represent a vector. I have started with an unit arrow with vertices defined as follows: //vertex data for vector with arrow GLfloat vertices[] = { //line 0.0f, 0.0f, 0.0f, …
Sayan Pal
  • 263
  • 1
  • 9
4
votes
2 answers

How to generate binary gltf array buffers?

I'm looking for any way which enables me to quickly generate gltf files including the conversion of plain array buffers (vertex, index, color, etc.) into binary (bgltf, glb, bin) files. I'm asking because it currently looks like there are only high…
q9f
  • 703
  • 2
  • 8
  • 22
4
votes
1 answer

Computing camera front direction from Euler angles

I am new to OpenGL and Computer Graphics in general. Lately I was learning how to model a camera, specifically how to model the rotation of camera. I was introduced to Euler angles for this purpose. I got a rough idea about how to use Euler angles…
Sayan Pal
  • 263
  • 1
  • 9
4
votes
2 answers

How to generate OSX Flurry screensaver

I want to generate video similar to OSX Flurry screensaver (screenshot, video), but I have no idea how it is made. Does anyone here has an idea about how it's made, its algorithm and method?
Ryan
  • 43
  • 4