Tag Info

Hot answers tagged

7

UV interpolation needs to take into account the depth of the vertices. You need to perform perspective-correct interpolation, which involves dividing by the w coordinate of the interpolated homogeneous vector. The "folded plane" effect of affine interpolation becomes more pronounced at wide FOV or when the camera is close to an object, but it's not ...


7

I am going to assume you already know some basic linear algebra, the kind involved in: 3d projections, camera setup, transforming vertices into world position, etc... If you don't, there are plenty of great places to learn from. Here are two that I like: Game Engine Architecture Brief coverage of basic linear algebra but does cover everything you need to ...


5

This is a pretty broad topic. There are two basic parts to it, though: the actual theory of the graphics transformation and rasterization pipeline, and the actual implementation bits that let you blast pixels on the to screen however you choose. On top of that, there is also optimization (particularly of the latter bit). The first part is fortunately the ...


4

I took a quick look at your example and your code. You're extremely close to solving this, so I don't mind helping with a question that looks suspiciously like homework ;). In data.js, you are assigning the same UV coordinates to the front and rear faces of the cube. The coordinates seem to be ([0,0], [0,0.5], [0.5,0.5], [0.5,0]). This means that you can ...


3

This is a valid approach normally known as the Painter's Algorithm. Sorting your triangles will not support overlapping triangles. By that I mean two triangles that overlap in a way such that half of one triangle is infront of the other, while the other is behind. If you don't need to support this, you could probably just do sorting back to front. That is, ...


3

The proper way to determine if you can create a device of a particular type (hardware / software) with particular feature levels is to attempt to create a device with the options you want, and if that fails, fall back to a less-featured device. The documentation demonstrates this technique for feature level fallbacks, and you can apply a similar one for ...


3

If you pretend a pixel is a square (see A Pixel is Not a Little Square), then the center of that square is the pixel coordinate. This is documented in Direct3D 9's rasterization rules (emphasis mine): Direct3D uses a top-left filling convention for filling geometry. This is the same convention that is used for rectangles in GDI and OpenGL. In ...


2

Golden rule when you are using floating point: count on every calculation to have an error in the result. It looks like your texture mapping is mapping a bit of memory past the edge of the textures. This may be because of floating point error. This part catches my attention: z = (1/z); uv.u = Math.round(uv.u * z *100);//*100 because my texture is ...


2

Quick answer: Z is not a linear function of (X', Y'), but 1/Z is. Since you interpolate linearly, you get correct results for 1/Z, but not for Z. You don't notice because as long as the comparison between Z1 and Z2 is correct, the zbuffer will do the right thing, even if both values are wrong. You will definitely notice when you add texture mapping (and to ...


2

descent uses a portal rendering engine this engine divides the world in convex rooms and the engine knows which room you are in then to render you render the rooms faces and for each visible face that is a portal you adjust the frustum and render the room that the portal links to in psuedo code: renderRoom(room) { foreach face in room { ...


1

In some ways, rasterisation is the opposite problem to raytracing. In raytracing, you know which pixel you are testing, and you have to find the triangles that are hit by the ray through it. In rasterisation, you have information about a triangle and you need to find which pixels it covers. Basically, the vertices describing the triangle are projected into ...


1

Major 3D animation suites support writing custom plugins/extensions (scripts and/or .dll/.so files). For example Blender use Python for scripting (API). This may or may not be enough for what you are trying to achieve because not all [custom] data (e.g. colour changes you have mentioned) will be exported to supported formats thus you might be forced to ...


1

Dokkat, from my experience I can tell that Unity 3d Mecanim animation has a sophisticated system for all sorts of animations, with the Mecanim tools the ammount of code you MUST write is limited, but the sky's the limit. You have plenty options to choose from. http://docs.unity3d.com/Documentation/ScriptReference/Animation.html I have to note that it will ...


1

According to here For maximum speed, perspective correction is performed only every 16 pixels. This is normally fine, but it is possible to see texture ripples in surfaces that are viewed at sharp angles. For more precise texture mapping, set the console variable d_subdiv16 to 0. Doing this will result in somewhat slower performance, however, ...



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