# Tagged Questions

Polygons with three corners or vertices and three sides or edges which are line segments.

17k views

### Why do game engines convert models to triangles compared to keeping it as four side polygon

I've worked using maya for animation and more film orientated projects however I am also focusing on my studies on video game development (eventually want to be either programmer or some sort of TD ...
3k views

### Why are triangle fans not supported in Direct3D 10 or later?

http://msdn.microsoft.com/en-us/library/windows/desktop/bb206271(v=vs.85).aspx Why? Are there inherent drawbacks to working with triangle fans?
1k views

### Triangulation A* (TA*) pathfinding algorithm

I need help understanding the Triangle A* (TA*) algorithm that is described by Demyen in his paper Efficient Triangulation-Based Pathfinding, on pages 76-81. He describes how to adapt the regular A* ...
421 views

Most of the time in the first chapters of a random book about rasterization and rendering techniques, I find some phrases about a triangle-based rendering system and a quad-based one. I have never ...
5k views

### Unity's “Stats” window displays bizzare number of triangles and vertices

In my Unity scene I have: 7-8 Barrels (with lids) each at about 2-400 triangles. 4 planes, each at at the very most 200 triangles camera, 3 lights, a FPS controller When I turn on the "Status" ...
2k views

### Triangle-triangle continuous collision detection

I am making a 3D game engine and I use continuous collision detection. I am using Sphere-Trees to cull primitive collision checks to a minimum. However, I'd like to perform continuous triangle-to-...
3k views

### How do you triangulate an arbitrary polygon?

I need to triangulate a polygon for rendering in opengl es on android ( no glu triangulation available) Is there an already known algorithm for polygon triangulation? The polygon can be convex or ...
3k views

I'm curious to know which is better for games? Quads or Triangles? Wouldn't quads be better for rendering performances and smoothing out tessellation?
1k views

### How to draw a trapezoid in OpenGL?

The question seems easy, but you simply change vertex positions to match the corners of a trapezoid but it simply fails. I've tried scaling top and bottom edges like this : but when I apply my ...
275 views

### What does “kTriangles/s” mean in hardware graphics benchmark reports?

I've looked around and found several sites offering benchmarking statistics for mobile platforms and I've been seeing the unit of measure as "kTriangles/s". Originally I misread this, missing the 'k'; ...
404 views

### Optimizing models & improving performance

I've created a map editor for a game I've been developing. The maps (planets) are made using a form of meta ball editing. Basically, in the end the Marching Cubes algorithm is used to get my final ...
6k views

### Triangle - Rectangle Intersection in 2D

I had previously asked this for 3D but now I changed my strategy and would like to do the intersection in 2D. The Rectangle is axis aligned and will always be in a fixed position, and has a constant ...
278 views

### Create shape from points / lines in editor and mathematically calculate nearest points within shape

If I want an editor that accepts "points" of a minimum of three (a triangle) and I just add some points first, like this: how can I mathematically connect these corners (points) into an object of ...
3k views

### Triangle-Plane intersection in 3D space

I would like to clip a triangle if its bounds lie partially out of a cube for this I guess I would need some kind of Triangle Plane intersection code, I'm not well versed with math but I do have the ...
143 views

### Make a triangular mesh from of a map defined by points that follow the coast lines

I have a set of points which follow the coast lines of a world map. I would like to somehow triangulate so that I can render the continents filled in. The points seam to be in order so that if you ...
251 views

### Ray Triangle Intersection issue

I'm trying to perform ray triangle intersection on a mesh made of triangles. The below code seems to work fine but only about 50% of the time. The ray often gets into positions where no intersection ...
2k views

### How does a BSP tree work for Z sorting?

I'm developing a 3D engine in software, and so I must compute Z sorting manually. I'm currently using the painters algorithm to sort triangles and then drawing them back-to-front. This causes ...
681 views

### How to draw a line of a given length towards a given object?

I wanna draw a line between two moving objects I can't use: cDrawLine(startPointCG, endPointCG); because the line must have a length. So I'm trying to measure the angle between those two points ...
1k views

### Ray-plane intersection to find the Z of the intersecting point

I have a rectangle in 3d space (p1, p2, p3, p4) and when the mouse rolls over it I need to calculate the exact Z of the point on the rect, given the mouse coordinates (x, y). Would a Ray-plane ...
136 views

### Algorithm for triangle picking?

So i found out that i need a triangle picking algorithm, i need to see if my mouse is over the triangle. I've heard what color picking is, but it would pretty much just drop the performance twice (...
133 views

### The better performance in occlusion culling, plane or quad?

In the above picture, when the left camera shows two small parts of the quad, all of that is rendered (it can be a very large quad). But in the right one only two small parts of it is rendered. Which ...
177 views

### Generate 2D Triangular Mesh from Vertices on a Map

Given a map of vertices {(x1,y1), (x2,y2), ... (xn,yn)}, how can I generate a 2D triangular mesh covering all vertices, and where the area of all triangles completely covers the map? The triangular ...
334 views

### Moller Tri Tri intersection

I'm done implementing Moller's tri-tri intersection routine. It gives you the location of where each triangle edge intersects the line of intersection between the 2 triangle planes: Really you get ...
417 views

### Generating mesh along path

I'm currently trying to generate a path along an array of points(Vector3) This is the result i'm currently getting The dark gray points are the given path The red points are the generated verticies ...
878 views

### Fastest way to find closest triangle of mesh from specified point

I have two triangle meshes (let me call them A and B). The meshes may be really big (10.000 - 100.000 polygons). I want to find for every point in A the closest triangle from mesh B. Is there fast ...
2k views

### How do you split indices and vertices if their quantity goes over the limit?

I try to draw a flat surface of 500x500 squares which are built out of four vertices by two triangles. There are 1,000,000 vertices and 1,500,000 indices. The Reach profile of xna, limits primitives ...
8k views

### Mesh with quads to triangle mesh

I want to use Blender for making models yet realize some of the polygons are not triangles but contain quads or more (example: cylinder top and bottom). I could export the the mesh as a basic mesh ...
1k views

### Drawing a textured triangle with CPU instead of GPU

I understand the benefits of GPU rendering and such, but for a certain limited application I need to render textured triangles purely using CPU. I've built a 3D engine capable of object handling, ...
364 views

### Angle between two planes

I have two triangles in 3d space which share 1 edge and I would like to determine if the angle between their normal vectors is "uphill" or "downhill". In other words, if you set one flat, would the ...
494 views

### Polygonal Triangulation - algorithm with O(n log n) complexity

I wish to triangulate a polygon I only have the outline of (p0, p1, p2 ... pn) like described in this question: polygon triangulation algorithm and this webpage: http://cgm.cs.mcgill.ca/~godfried/...
4k views

### How do I find the circumcenter of a triangle in 3D?

I want to find the circumcenter of a triangle. Wolfram only shows how to find the circumcircle of a triangle in R2. How can I find the circumcenter of a triangle in R3?
87 views

### Good way to support multiple types of triangles? (C# XNA)

[this question is somewhat long. here's my question in a nutshell] I want to use multiple types of Vertex data types for my triangle, interchangeably. So if I have a generic type T private void ...
550 views

### How does the Direct3D 9 rasterizer determine triangle coverage?

I'm working on a software rasterizer to use in my project. I have implemented one that works well, however, often my rasterizer under or over estimates triangle coverage. I need perfect emulation of ...
519 views

### Software rendering 3d triangles in the proper order

I'm implementing a basic 3d rendering engine in software (for education purposes, please don't mention to use an API). When I project a triangle from 3d to 2d coordinates, I draw the triangle. However,...
261 views

### Calculate the slope of a 3D triangle?

I have lots of triangles in 3D space. How do I determine the slope/angle of these triangles with respect to a fixed ground plane? I need pseudo code examples at the very least. Thanks!  Based ...
246 views

### SAT test for Triangle - convex hull

I'm having real trouble resolving this issue with triangle-convex hull SAT test intersection. The problem is as follows: Misses are detected accurately enough: Clear miss I have not found a ...
387 views

### Directional, Triangular Collision Detection in Pygame [duplicate]

I am trying to create a game in Pygame, with Python 3, and am trying to figure out an algorithm that will tell me which direction a rectangle is colliding with a rectangle, so that I can push it back ...
333 views

### Dynamically creating astar node map by triangular polygonal map

My game's map format uses a bunch of triangles to make up the platforms and terrain in 2d. Right now I can set up a 2d array of nodes for the astar algorithm that basically is a bunch of rectangles ...
227 views

### Drawing multiple triangles at once isn't working

I'm trying to draw multiple triangles at once to make up a "shape". I have a class that has an array of VertexPositionColor, an array of Indexes (rendered by this Triangulation class): http://www....
701 views

### Why is my mesh generation algorithm not working properly?

I am trying to generate a grid in OpenGL ES, using known methods for triangle strips and stitching as shown in: this post and this post The code below, generates the vertices for a 4x4 grid with a ...
307 views

### Given face normal and vertices of a triangle, how to find the acyclic order of vertices?

I'm in the process of constructing a custom 3D triangle mesh. I found the vertices of the triangle in the 3D space and it's face normal. How do I find the acyclic order of vertices? If I draw the ...
822 views

### What are the basics of 3D triangle/quad sorting?

I am really curious how any 3D engine or even the GPU sorts triangles and quads. Are they basically taking a "center" point of a particular triangle/quad/poly and then calculate a distance from a ...
846 views

### Triangles go missing as Z changes

I'm rendering a height map using shader-based OpenGL (3.3 to be precise). The height map data is from a grayscale bitmap (2D array of bytes). The dimension of the bitmap is 256 x 256. With this data, ...
208 views

### Point[] and Tri not “could not be found”

Hi I'm trying to learn how to load a .obj file using OpenTK in windows Forms. I have seen a lot of examples out there, but I do see almost everyone uses List, and Point[]. Code example show these ...
339 views

### Texturize a shape of multiple triangles in 2D

This is an example of a shape consisting of multiple points, triangles and eventually a shape: Red Dots = Vector3 (X, Y, Z) or Vector2 (X, Y) If I have a Texture of a certain size, how do I ...
1k views

### Opengl create tunnel TRIANGLES and texture coords on a 3d path

I have a path, lets say a bezier, or a circle. I d like to make a continously 3d cylinder (tunnel) on it (R=0.5f) How can I calculate tha TRIangles (TRIANGLE_STRIP) coordinate, and the texture ...
120 views

### How to reproduce this triangle filling scanline effect using a shader?

I'm writing a renderer for an old DOS game were 3D polygons were rendered in software. I'd like to simulate, using a shader, the following material/effect, used for filling a triangle : The fist ...
181 views

### Does triangle-plane clipping in 3D always produce a triangle?

When you clip a triangle against a plane, will you always get a triangle out? Are there perhaps cases where you don't get a triangle out of clipping it against a plane?
1k views

### Triangle-Triangle Intersection Code

Does anyone have experience implementing this triangle-triangle intersection code that I found online? I don't understand it. I made a post on Stack Overflow about this and got the advice that: ...
344 views

### OpenGL drawing, breaking down triangles

if I want to use no textures in a game (i.e png's), would I just break down my drawing into triangles and combine them the way I want? I found this in Google Images.