Hot answers tagged

21

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 assumption that its faster is a bit flawed. Even if it would be faster, it would be less efficient in terms of development (like 1% speed increase for 10 times the ...


15

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 all hardware, because the hardware wasn't doing much. A graphical accelerator allows the drawing of pixels considerably faster than a CPU can, by using ...


14

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 fragment shader. This was all done in software in the 90's when your video card wasn't much more than a blitter and a frame buffer, but it was slow as hell. Hence ...


13

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 increasing the detailing of the mesh geometry? Human eyes cant actually see curvature except on the edges of objects. All they can do is approximate the smoothness and ...


13

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 resulting surface. For an example, take a look at these two boxes: The left one is all quads; the right one has the same overall shape, but one corner is made ...


12

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 that you are computing the distance between the point where the view ray first enters the cube and where it first hits the interior wall, and using that as your ...


9

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 the box can cut off one corner of the polygon, replacing one vertex with two. So 3 vertices + 6 added vertices due to clipping = 9 total.


8

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 few formats more dominant than others. Just as it is with image file formats, the PNGs and JPEGs are the most common formats out there today, but there is no ...


8

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, generating a 2D matrix with the rows as each point and columns as the components $x$, $y$ and $z$. That way, you could handle the projection using a simple matrix ...


8

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 transformation. In contrast a perspective projection is not a parallel projection and originally parallel lines will no longer be parallel after this operation. Thus ...


7

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 looks like this: The spheres become circles with the center points $C_1$ and $C_2$, and the intersection circle is now only 2 points with only the closer one $P$ ...


7

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 algorithm or DDA to draw lines in between. If you want to fill them too you can use scanline (you can find it on Wikipedia). For ellipsoids, you can either just turn ...


7

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 order to avoid extra work, homogeneous coordinates and affine transformation was introduced. Now instead of doing $v' = Lv + t$ where L is a linear transform ...


6

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 \sin \frac{x}{r}$ out horizontally where $r$ is the radius of the planet you are modeling (~6.3k km for earth). In the vertex shader you can account for that ...


6

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-focus, causing conflicting cues. The lens in the eye tries to adjust to bring the object into focus, but of course it won't succeed, causing eye strain and ...


6

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 to see if the face was looking towards or away from the view point. My erroneous step was that I was doing this AFTER transforming from world-space to view-...


6

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 renderer but at least one is a standard. So you might be looking for something like: RIB, Renderman Bytestream although it comes with as a programming api as well. ...


6

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. Basically it says in what order you rotate the object. First you rotate the object around the x axis, then the y axis and lastly the z axis for example. This means ...


6

A standard technique is to use a ray/sphere intersection test inside a pixel shader. One draws a billboard large enough cover the area the sphere could appear on the screen (or drawing a bounding cube) to reduce the number of wasted intersection tests (other geometric shapes could be used). The fragment is killed if the intersection test fails; if an ...


6

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 want to assemble them into a 3D model. That's a much easier problem, the kind you can solve from the comfort of your couch. Do know the cutting planes that ...


6

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 little too regular (I'm no modeler though). The skin's subsurface scattering falls a bit short. Perhaps it's not that but there is something slightly off about the ...


6

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 for obvious reasons any 6 variables that are independent of each other would do this. The problem with vectors is that they aren't the most efficient way to ...


6

Having not worked on these games, I can only speculate... but from your description, it sounds like a crude shadow map with orthogonal projection and no depth information. It probably has (or had) a specific name but the way I suspect they did it is: Render the character from above to a binary texture (eg. white there there's nothing, black where the ...


5

Before we begin, let us differentiate between two things: The shape of a sphere, and the topology of a sphere. A NURBS surface can make the shape of a sphere. In a typical configuration, it will be 'open' at the poles. That is the mathematical function of the surface does not wrap over the pole in that it is not a true sphere (it has the shape of a sphere)....


5

There is no standard format for 3D models. Some common ones are listed in glampert's answer, more can be found in this SE answer. If you are designing your own format for your own purposes, (a fairly common thing to do, actually) it's a good first step to look at how you are using your model data. For example, if you are focused on rendering, you can use ...


5

Normally if you paint a background image you simply draw a textured full-screen square while depth testing and writing is disabled before drawing the actual scene (where you re-enable depth) In the code you posted you draw the quad but then clear the screen again. Don't do that. Move the drawing of the quad from main to right after the glClear call.


5

Your screen isn't 3D, so how do you display 3D objects on it? You need to map 3D coordinates into 2D space. This also explains why your OpenGL code is not behaving how you're expecting it to. Sorry if parts of this answer are things you already know (just trying to be comprehensive). What do the model view and projection matrices do? The model view matrix ...


5

This is a quite common property of smoothing in 3D. When you have some data and you smooth it out you get some kind of average of the local variation. And this works fine, and stably, in one dimensional graphs. But when your entire data set is being smoothed over its coordinates the neighboring coordinates drag your data with them. Those again are dragged ...


5

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, one rotation builds upon the next (or previous/whole stack if your inclined to model it that way). Image 1: Rotation is like a gimbal. Model using yxz rotation (z=blue, x= red and y=green) in ...


5

The magic is that the mesh is attached to the skeleton. In it's simplest form, this is done by assigning each vertex to a bone. When a vertex is assigned to a bone, that means that it will always keep the same position relative to that bone's position, and orientation (normal, tangent, bitangent aka the bone's local X,Y,Z axis) as the bone moves as ...


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