Hot answers tagged

29 votes
Accepted

World coordinates, Normalised device coordinates and device coordinates

World coordinates are at the bedrock of your game world. The 3D positions of all objects are ultimately specified in world space, either directly or through a node hierarchy. The ground, buildings, ...
Nathan Reed's user avatar
  • 24.7k
26 votes
Accepted

Why are quads used in filmmaking and triangle in gaming?

For 3D modeling, the usual reason to prefer quads is that subdivision surface algorithms work better with them—if your mesh is getting subdivided, triangles can cause problems in the curvature of the ...
Noah Witherspoon's user avatar
23 votes
Accepted

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

Speed is the most common reason why this is not done. In fact you can do what you propose, if you make your own operating system, its just going to be very slow for architectural reasons. So the ...
joojaa's user avatar
  • 8,367
16 votes
Accepted

Why smoothed meshes in 3D studio end up with the same number of vertices/triangles? How then can they be smoothed with the same geometry?

Smooth in this case just makes the surface normals at vertices point the same way, when interpolated it looks smooth. Meshsmooth would add vertices. 1) how is the smoothing possible without ...
joojaa's user avatar
  • 8,367
14 votes
Accepted

Is this the correct way to implement Beer's Law?

Your image definitely does not look correct, and it appears that you are not correctly computing the internal path of light rays as they travel through your mesh. From the looks of it, I would say ...
MJP's user avatar
  • 586
14 votes

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

Just to add to joojaa's answer, things are still being drawn pixel by pixel. You're just generating the pixels using a vertex shader/assembler/rasterizer, then texturing and lighting them using a ...
russ's user avatar
  • 2,342
14 votes

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

work on any 32-bit color GPU (even old ones)? Bit of history here: this is how games were done on PC up until graphical accelerators started to become available in the mid-90s. It did indeed work on ...
pjc50's user avatar
  • 241
13 votes

How to achieve gimbal lock with Euler angles?

A gimbal is a pivoted support that allows you to rotate around one axis. Now it so happens that Euler rotations* work like a set of 3 gimbals attached to each other,...
joojaa's user avatar
  • 8,367
11 votes
Accepted

What's the difference between orthographic and perspective projection?

Orthographic projections are parallel projections. Each line that is originally parallel will be parallel after this transformation. The orthographic projection can be represented by a affine ...
joojaa's user avatar
  • 8,367
11 votes
Accepted

How to achieve gimbal lock with Euler angles?

Rotations in 3D are normally done with matrices. The xyz Euler angles can be converted to matrices so that it can be used in the rotation. That is where something called rotation order comes in. ...
bram0101's user avatar
  • 1,595
9 votes
Accepted

Maximum number of vertices after clipping a triangle against an AABB

Funnily enough, I asked this exact question on Math.SE a couple years ago: Maximum number of vertices in intersection of triangle with box. The answer is 9 vertices, because each of the 6 planes of ...
Nathan Reed's user avatar
  • 24.7k
9 votes

Why are quads used in filmmaking and triangle in gaming?

As @Noah Witherspoon correctly, says triangle subdivision does not work as well as quad subdivision. Although, in the beginning triangles could not be subdivided at all. However, he does not really ...
joojaa's user avatar
  • 8,367
8 votes
Accepted

Is there a standard specification for 3D graphic representation?

When talking about file formats, we are talking about persisting some data related to a 3D model/geometry. There is no universal standard on file formats for persisting 3D geometry. There are only a ...
glampert's user avatar
  • 1,439
7 votes
Accepted

Is my perspective math correct?

Identifying your axes in both figures and adding the camera position to your first figure would help you understand what's going on. You could also have a single variables for all your points, ...
Soravux's user avatar
  • 371
7 votes
Accepted

Sphere intersection occlusion (for hybrid raytracing)

Given that I didn't miss anything, you can probably cut this down to a problem in the 2D space. Viewing onto the plane defined by the center points of the spheres and your camera origin, the scene ...
Nero's user avatar
  • 1,310
7 votes

What formula or algorithm can I use to draw a 3D Sphere without using OpenGL?

Scratchapixel has a nice tutorial on writing a basic rasterizer here. Also, you could use the projection algorithm here to get the position of the vertices in screen space, then use Bresenham's ...
Sam's user avatar
  • 198
7 votes
Accepted

Why do I need to inverse the orientation matrix of a camera to be able to translate it in the direction it is facing?

People always forget that there is no "camera" in OpenGL. In order to simulate a camera you have to move the whole world inversely. So if you want ur camera looking 30 degrees downward, you move the ...
gallickgunner's user avatar
7 votes

What is the use of homogenous divide?

First of all we need to understand why do we need 4x4 matrices in the first place. With 3x3, we couldn't represent translation as it wasn't a linear transformation (it displaces the origin). So in ...
gallickgunner's user avatar
6 votes

Earth curvature and horizon in modeling large scenes

Having the horizon fall off is simply dropping the ground in the distance down somewhat. A point $x$ km away if you follow the curve of the planet will be $r-r\cdot \cos \frac{x}{r}$ down and $r\cdot ...
ratchet freak's user avatar
6 votes
Accepted

Is depth of field incongruous in a 3D still image?

In traditional stereo 3D, I don't believe that there is a way to make a fixed focal plane feel natural to the viewer. When looking at an out-of-focus object in stereo 3D, the object remains out-of-...
Benedikt Bitterli's user avatar
6 votes
Accepted

Graphics Pipeline: Viewspace & Back face culling incorrectly

I (believe) I've solved this (even if it has taken 2 days). My problem was essentially I wanted to take the dot product of the face normal, and line-of-sight vector like below And determine the angle ...
davidhood2's user avatar
6 votes

Human Readable/Writable 3D Representation Formats/Languages?

There are a number of formats that might fit the bill. Depends on what you want to achieve. Most likely your looking for a scene description language for renderers. Many of them are for that one ...
joojaa's user avatar
  • 8,367
6 votes

How to build a 3d model from 2d pictures

This is a bit different from a conventional photogrammetry problem. You're not trying to estimate a 3D world from 2D projections. You have actual 3D information - you have the imaging slices - and you ...
Jacob Panikulam's user avatar
6 votes

What is missing in this image that stops it from looking like a photograph?

The hair seems to have sampling noise or aliasing in it. This might be poor jpeg compression but it does not look like it. I've never seen hair part that way (could just be me). The neck looks a ...
Olivier's user avatar
  • 1,585
6 votes
Accepted

Minimum requirements to uniquely represent a 3D object in space

A rigid body has 6 degrees of freedom, in 3D- space. So that means you need 6 values to represent the object. The common way to do this is to store a position vector for position and 3 rotations. But ...
joojaa's user avatar
  • 8,367
6 votes

Was Evans & Sutherland CT5 really created in 1981?

The CT5 was designed before 1981. I started working at E&S in May 1981. The CT5 was fully designed by then and 3 had been built. All 3 were still at E&S and hadn't shipped yet when I started. ...
John's user avatar
  • 61
6 votes
Accepted

How do graphic engine developers debug their 3D graphics code?

I'm programming mostly in OpenGL. In this case, the very first thing I do is setting up KHR_debug extension. It provides a way to subscribe to messages generated by GL drivers - from errors to ...
joe_chip's user avatar
  • 237
6 votes

Generate mesh from pointcloud data

one popular Real time surface reconstruction method is TSDF (Truncated Signed Distance Function) used by Microsoft for the Kinect. It is based on the VRIP method but it is faster. It is based on depth ...
ChaimDryzun's user avatar
6 votes
Accepted

Could some give an explanation or hint about this kind of equation? $\left(- \sqrt{X^{2} + Y^{2}} + 1\right) \cos{\left (2 \pi X + \phi \right )}$

The R part generates a cone where the point is at (0, 0, 1) and it spreads out below that. It meets the x-y plane at the unit circle: The ...
user1118321's user avatar
  • 3,391

Only top scored, non community-wiki answers of a minimum length are eligible