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

learn more… | top users | synonyms

37
votes
8answers
14k 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 ...
12
votes
3answers
2k 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?
10
votes
1answer
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* ...
7
votes
2answers
387 views

Must I worry about quad-based rendering in real world scenarios?

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 ...
6
votes
2answers
1k 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 ...
6
votes
2answers
2k 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 ...
5
votes
2answers
3k 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" ...
5
votes
1answer
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 ...
4
votes
1answer
2k views

Quads Vs Triangles

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?
4
votes
2answers
269 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'; ...
4
votes
2answers
258 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 ...
4
votes
3answers
5k 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 ...
4
votes
1answer
254 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 ...
3
votes
4answers
215 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 ...
3
votes
2answers
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 ...
3
votes
4answers
630 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 ...
3
votes
1answer
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 ...
3
votes
1answer
135 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 ...
3
votes
1answer
221 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 ...
3
votes
1answer
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 ...
3
votes
1answer
336 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 ...
3
votes
1answer
267 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 ...
3
votes
1answer
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 ...
2
votes
3answers
6k 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 ...
2
votes
1answer
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, ...
2
votes
2answers
229 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 ...
2
votes
3answers
391 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: ...
2
votes
1answer
2k 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?
2
votes
1answer
66 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 ...
2
votes
1answer
382 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 ...
2
votes
1answer
367 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. ...
2
votes
1answer
194 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 ...
2
votes
1answer
68 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 ...
2
votes
1answer
316 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 ...
2
votes
2answers
213 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): ...
1
vote
1answer
584 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 ...
1
vote
1answer
163 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 ...
1
vote
1answer
661 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 ...
1
vote
1answer
83 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! [edit] Based ...
1
vote
1answer
364 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, ...
1
vote
2answers
198 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 ...
1
vote
2answers
312 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 ...
1
vote
1answer
955 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 ...
1
vote
1answer
55 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?
1
vote
2answers
314 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.
1
vote
1answer
204 views

Efficient way to draw multiple separated quads

Let's assume I want to draw several separated (possibly textured) quads in Direct3D 9, each consisting of two triangles: How should I draw these for maximum performance, i.e. which of the following ...
1
vote
1answer
199 views

How to optimize primitives in SecondLife/Opensim?

SecondLife/Opensim uses Primitives to construct models. How it works in details is explained here. Now I have many triangles which link together. Is there any way to make them into one prim, thus ...
1
vote
1answer
72 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 ...
1
vote
2answers
150 views

XNA Calculate two points of triangle with given Z

I want to calculate the two points of a 3D triangle that have a specified Z coordinate. I guess the way to do this would be to somehow create a plane which is perfectly flat with my given Z coordinate ...
1
vote
1answer
180 views

Drawing texture does not work anymore with a small amount of triangles

When i draw lines, the vertices are well connected. But when i draw the texture inside the triangles, it only works with i<4 in the for loop, otherwise with i<5 for example, there is a ...