triangle

how do I convert from one cartesian system to another

2D problem: I measure the position of the 3 ends of a triangle in a cartesian system. Now i move the system (triangle) to another cartesian system and measure the position of just two ends. How can I identify the location of the 3rd end based on this data? thanks! (and sorry for the bad english as a second angle) ...

Computational geometry, tetrahedron signed volume

I'm not sure if this is the right place to ask, but here goes... Short version: I'm trying to compute the orientation of a triangle on a plane, formed by the intersection of 3 edges, without explicitly computing the intersection points. Long version: I need to triangulate a PSLG on a triangle in 3D. The vertices of the PSLG are defined...

Accessing vertices in the triangle++ (delaunay/voronoi triangulation) Wrapper class

Hi, I'm using the triangle++ wrapper class from http://www.compgeom.com/~piyush/scripts/triangle/ to triangulate a point cloud for visulaizing with OpenGL. I was able to put in my points and caluculate the triangulation. After that i also was able to access the vertices over a vertex iterator, how it is shown in the main.cpp example inc...

Find the coordinates in an isosceles triangle

Given: (x1,y1) = (0,0) (x2,y2) = (0,-10) Using the angle to C, how are the coordinates at C calculated? ...

Testing if a line has a point within a triangle

How can I test whether a line has a point that lies within (not on the edge of) a triangle. (All in 2D). Currently I'm thinking I'll do this: Define the line, and each side of the triangle as Ax+By+C=0, and have an xrange. Check if the line intersects any of the lines of the triangle. If it does, check that this is NOT at the end of t...

AS3 / Java - find point of triangle by knowing other two points and segment lengths

Sorry if this doesn't make sense... I know the length of the triangle segments and the xy coordinates of two points. How do I figure out the xy of the 3rd point? ...

C++ - 3d geometry question

Hello! Right my own 3d engine (which I'm currently developing) has a very limited abilities in terms of geometry rendering and I want to expand it. What I'm interested in is how-it-should be done in terms of storing the geometrical objects and drawing them. For now my abstraction only supports rendering geometry as generic lists of t...

How can I efficiently detect intersection detection of a ray and a mesh?

I have several 3d models in an OpenGL ES application for iPhone and at some point i want the user to touch the screen and act on them. The problem is to recognize which, among the ones rendered on the screen, has been touched. In order to achieve this I calculated the picking ray as suggested by the OpenGL FAQ, and I now want to detect i...

How to rotate a 3D tringle flat against the wall?

I'm working with 3D mesh data, where I have lots of 3D triangles which I need to rotate to eliminate the Z value, converting it to a 2D triangle. With this 2D triangle I'm doing some vector calculations. After I'm done with my work I need to rotate it back to the original angle such that the old points return back to their original pos...

Calculate if two 3D triangles are on the same plane

For a 3D game engine I'm working on I need to calculate if two 3D triangles are on the same plane to display it accordingly. How do I calculate the angles of a triangle in 3D space? Would calculating a surface normal and comparing those ever give me 2 equivalent normals? ...

map points between two triangles in 3D space

Hello, EDIT I don't know is it important, but destination triangle angles may be different than these of source. Does that fact makes transformation non-affine ? (i'm not sure) I have two triangles in 3D space. Given that i know (x,y,z) of point in first triangle and i know vectors V1,V2,V3. I need to find point (x',y',z'). What tra...

Finding Whether A Point is Within a Right-Angle Triangle

I've always wondered the easiest way to figure out whether or not a point lies within a triangle, or in this instance, a rectangle cut into half diagonally. Let's say I have a rectangle that is 64x64 pixels. With this rectangle, I want to return a TRUE value if a passed point is within the upper-left corner of the rectangle, and FALSE ...

Finding the points of a triangle after rotation

I'm working on a (rather) simple 2D project in OpenGL. It's some sort of asteroids clone. The ship is basically an isosceles triangle of height H, with the base have a length of H/2. The way I've been doing it so far is simply storing the center point (CP) of the triangle and then calculating the final vertex positions on the fly. The ...

Triangularizing an arbitrary 4-Vertex Polygon

Here's a riddle for you. You have a polygon composed of exactly 4 vertices, call them v1, v2, v3, v4. They are given in any random order. How would you split these vertices into two sets, each defining a triangle, such that both triangles make up the polygon without overlap. The result should look like this: Triangle 1: v1, v2, v3 Tri...

Collision test between a triangle and a rectangle (AABB) in 2D

I've spent a good amount of time getting intersections working correctly between various 2D shapes (circle-circle, circle-tri, circle-rect, rect-rect - a huge thanks to those who've solved such problems from which I drew my solutions from) for a simple project and am now in the process of trying to implement an triangle-AABB intersection...

Triangle in draw2d library

Hi! I can't understand org.eclipse.draw2d.Triangle's api. There are some fields for manipulation: protected int direction The direction this triangle will face. Possible values are PositionConstants.NORTH, PositionConstants.SOUTH, PositionConstants.EAST and PositionConstants.WEST. protected int orientation The orientation of t...