geometry

Where can I find line buffering code?

I can't find any code for doing this. The only places I can find it is in GIS APIs. Preferably in java, but I can port other languages too. I'd even settle for a overview of all the formulas required. ...

what is the Euler rotation convention in truevision3d?

In what axis order are Euler angles rotated in the graphics API true vision 3d (tv3d)? I haven't been able to find it in any documentation. ...

How to orbit around the Z-axis in 3D

Hello folks, I'm primarily a Flash AS3 dev, but I'm jumping into openframeworks and having trouble using 3D (these examples are in AS) In 2D you can simulate an object orbiting a point by using Math.Sin() and Math.cos(), like so function update(event:Event):void { dot.x = xCenter + Math.cos(angle*Math.PI/180) * range; dot.y = y...

Nearest point on concave surface from point

Given a union of convex objects and a point p inside this union, how does one find the closest point on the (concave) surface of the union from p? For what it's worth I can easily find the closest point on the surface of a single convex object, it's the union of several that's giving me problems. EDIT: I'm terribly sorry, I meant the u...

Non axis-aligned rectangle intersection

I'm trying to find an algorithm that will compute the intersection between 2 rectangles, which are not necessarily axis-aligned, and return the resulting intersection. This question describes finding whether an intersection exists. I'd like to have the resulting shape of the intersection, if it exists. My application of the algorithm w...

Implementing Ray Picking

I have a renderer using directx and openGL, and a 3d scene. The viewport and the window are of the same dimensions. How do I implement picking given mouse coordinates x and y in a platform independent way? ...

Finding the coordinates on the edge of a circle

Using C#: How do I get the (x, y) coordinates on the edge of a circle for any given degree, if I have the center coordinates and the radius? There is probably SIN, TAN, COSIN and other grade ten math involved... :) ...

Export image as encoded geometry path

I have to set the Path.Data property of a Shape class. This I believe requires an encoded geometry path for the shape. Does anyone know of any software that will allow me to design my shape (for example MS Expression Design, Paint.NET, etc) and then be able to extract the encoded geometry path? ...

For problem solving..

This may be a bit OT... Here's the problem: "N different points with integer coordinates are given in a plane. You are to write a program that finds the maximum number of collinear points (they all belong to the same line)." Now my question: You don't have to solve this for me, instead I want to know where I can find some materials for...

CGAL 3.4: How do I get end vertex co-ordinates from a Finite_edges_iterator?

Here is some code: struct K : CGAL::Exact_predicates_inexact_constructions_kernel {}; typedef CGAL::Triangulation_vertex_base_2<K> Vb; typedef CGAL::Constrained_triangulation_face_base_2<K> Fb; typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef CGAL::Exact_predicates_tag It...

Geometry library for Java

Is there any geometry library available for Java? I'm looking for solution to get an intersection point(s) between two geometry objects. ...

draw two circles which has intersect each other,from that i need to find that intersect point using c#

Draw two circles which has intersect each other, from that I need to find that intersect point using c# using directx. I need to find two points. ...

Transform coordinates to find CGPoint after scale and move on UIView

Hi I have a UIView with a world map. This is added to a parent UIView, this parent UIView also has two markers build from UIViews. The markers are placed in the center of two arbitrary countries. Now I find the midpoint between these two markers moves the world map view so that this midpoint is at the center of the screen, I then conti...

Minimize RMSD between two sets of points

I need to plot the transformation of a 3d object against time. I have the 3d shapes for each moment in time, but they are not guaranteed to be geometrically well placed, so I cannot just render them and slap the pictures together into a movie. I therefore need to align them so that they are pleasantly and consistently oriented with respe...

Detecting self crossing in closed Bezier curves

I've created a "blob" shape by patching cubic Bezier curves together (screenshot below). I'd like to be able to detect the situation where a curve has crossed over either itself or another curve and was wondering if there's a recommended approach or known algorithm for doing this? One idea I had was to use a FlatteningPathIterator to d...

Compute union of two arbitrary shapes

I'm working on an application, I need to be able to combine two overlapping arbitrary shapes as drawn by the user. This would be a Union operation on the two shapes. The resultant shape would be the silhouette of the two overlapping shapes. The shapes are stored as a sequence of points in a clockwise manner. Ideally I'd like an algorit...

calculate the degree between two triangles in ansi c cuda

hi wanted to calculate the degreee between two triangles where every point of them has a 3d coordinate.... i.e. triangle 1: point1(x1,y1,z1), point2(x2,y2,z2), point3(x3,y3,z3). triangle 2: point1(x1,y1,z1), point2(x2,y2,z2), point4(x4,y4,z4). yes, the triangles always share exactly same two points. is there a way to calculate the degr...

Javascript Trinomial Problem

Ok, using Javascript (or something I can easily convert, I know BASIC very well, but a little rusty at C++ and C#) I need to solve this problem/equation: Given the start and endpoint of a line (in x, y, and z) what point on the line satisfies the equation A*x+B*y+C*z=D A, B, C and D are defined, but x y and z are unknowns, but are s...

3d Parabolic Trajectory

Hi, I'm trying to figure out some calculations using arcs in 3d space but am a bit lost. Lets say that I want to animate an arc in 3d space to connect 2 x,y,z coordinates (both coordinates have a z value of 0, and are just points on a plane). I'm controlling the arc by sending it a starting x,y,z position, a rotation, a velocity, and a...

Using the 4x4 Matrix3D from flash10 for non-affine 2D transforms

Hi! I've been having a very tiresome time when using flash10's Matrix3D class for 2D non-affine transformations. Basically, I have a square in a sprite and four points that form a quadrilateral, and I want to apply a transformation to the sprite to make those points the vertices of the sprite. There wouldn't be much problem solving thi...