A branch of mathematics concerned with questions of shape, size, relative position of figures, and the properties of space.

learn more… | top users | synonyms

1
vote
3answers
67 views

How do I interpret the dot product of non-normalized vectors?

I know that if you take the dot-product of two normalized vectors, you get the cosine of the angle between them. But if I take the dot-product of two non-normalized vectors (or one normalized, one ...
0
votes
0answers
24 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
1
vote
1answer
48 views

Algorithm that cover one mesh by another mesh

Suppose I have two meshes (Let call me first MeshShirt and second - MeshBody) Meshes are aligned (if i render both MeshShirt "covers" MeshBody). But some parts of the body are not "under" the ...
0
votes
1answer
74 views

Formula to measure uv-mapping distortion

Does anyone know a simple way of calculating (offline) the amount a texture is distorted when mapped to a triangle like the following? Vertex Position UV Coordinates A (Ax, Ay, Az) ...
1
vote
1answer
60 views

Chamfered cube geometry generator

I'm trying to create a geometry generator for a "Chamfered Cube". I've got the vertices working, but I'm stuck with creating the faces. I don't really know how I could re-arrange my algorithm to ...
0
votes
0answers
34 views

Calculation technique for 2D inertia tensors?

Just wondering what the techniques are out there. It's only 2D so I figured there'd be a good chance for there to be a "one size fits all" solution out there that's essentially an analytical solution. ...
0
votes
1answer
69 views

Given seams, how do I unfold a mesh?

If a user marks a seam on a mesh, how do 3D modelling programs (like Blender or Maya) unfold the mesh on to a 2D surface? I can only find papers trying to automate the seaming for you. Given ...
1
vote
1answer
69 views

Get quaternion between two objects on sphere

In a planetary gravity environment objects are represented in the following way: struct object { struct quaternion quat; // quaternion to represent the rotation between the object and the center ...
1
vote
1answer
35 views

How to access Maya Bonus Tools 2012 in Maya 2014

I have been trying to use the paint geometry tool for Maya 2014 but it isnt showing up. I downloaded Bonus Tools 2012 and installed it. Where can I find this tool in Maya 2014?
0
votes
1answer
132 views

How to determine the distance between a point and a rotated rectangle

This question is very similar to How do I calculate distance from a point to a rectangle?. But that question assumes that the rectangle is axis-alligned, or not rotated. So just like in that ...
1
vote
1answer
122 views

In a TPS, how to aim bullets to the direction the camera is pointing, but make the shooting from the player?

(In C#/XNA.) I mean, I can't find an answer nowhere. I'm trying to learn how to make a Third Person Shooter, especially like the one I found in a game called "M.A.R.S.", from Epic Games. I don't want ...
2
votes
1answer
58 views

Distort a quad with a World Matrix

Is it possible to distort a quad multiplying its vertices by a specific world matrix? See the picture to understand what kind of distortion I need: Please note, that the quad is in 3d space and I ...
0
votes
3answers
44 views

Calculating the center of a turning circle

I'm trying to understand how to calculate the midpoint of a turning circle. In the attached picture, my unit is at location U. I want to compute the trajectory of the unit as it turns toward the ...
3
votes
1answer
100 views

How can I animate characters' static-geometry eyes?

Here's a Nintendo example: Specifically, the animation of the pupils seems not to animate the geometry. How is this done?
0
votes
1answer
84 views

How to calculate “real” distance between cursor and away object?

I don't really know how to formulate the title, but the problem is the following: I'm using a scripting language called "SQF" which has been created by a company named "Bohemia Interactive" (no, I do ...
1
vote
1answer
48 views

Rotating a square rendered on a Bitmap

I'm writing a Software Renderer for fun/learning. Basically, it's just a giant array of integers which contain hexadecimal values (representing colour) that are rendered to the screen.... int ...
2
votes
2answers
45 views

Calculating angle a segment forms with a ray

I am given a point C and a ray r starting there. I know the coordinates (xc, yc) of the point C and the angle theta the ray r forms with the horizontal, theta in (-pi, pi]. I am also given another ...
3
votes
2answers
328 views

How to calculate direction from initial point and another point?

I'm making a simple game where I shoot things from a certain point on screen (A). I tap the screen and shoot the projectile from initial point(A) to the tap point(B). But I want the projectile to ...
7
votes
3answers
593 views

How do I translate a spherical coordinate to a Cartesian one?

Could someone point me in the right direction as to how this might be achieved? 3D math / geometry often throws me. I'm looking for something like this (ideally in C#): public Vector3 ...
1
vote
1answer
26 views

Error in plane transformation

I have a bunch of coplanar points, who sit on plane P. I want to translate the plane to Q with the points upon. Here is what I do: I take three points from P, say a, b, c. Their centroid is denoted ...
0
votes
1answer
46 views

Picking a local origin as the centroid of given three points in 3D

Given three points non-collinear P, Q, R in 3D, I need a generic method to generate x', y', z' unit vectors that behave like origin of local coordinate system. x' and y' vectos should be on the plane ...
1
vote
1answer
66 views

How do I combine matrix transformation with non-uniform screen scaling in Flash?

I'm using a Flash transformation matrix for affine transformation. I have a rectangular image being rotated and scaled (in 2D). There are two sets of scaling variables, ScreenScaleX and ScreenScaleY, ...
0
votes
1answer
48 views

Geometry design and buffers

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do: Init: Stock array with positions, array with colors, array with ...
1
vote
2answers
87 views

How to find the points of intersection of two OBBs

In my game I need to be able to find the points of intersection between two OBBs. I'm using Separate Axis Theorem to check if there's an intersection and get the penetration vector if there is one. ...
0
votes
2answers
118 views

which quarter of a triangle the point is in

I've got a world made out of squares. The square are devided in four triangles like this: The corners have their heights stored in a 2D array and the center height is the average of the corners. To ...
3
votes
1answer
326 views

Explain this line segment intersection code

I've been reading this article on pathfinding over polygon meshes using line-of-sight, and in the article are several code snippets. One of them, the one I'm trying to understand, is a simple function ...
3
votes
2answers
208 views

How to make a projectile align correctly with the entity that shot it

I'm developing a 2D game. In the game, all entities can rotate 360 degrees. Each entity holds an angle value, and every frame it is drawn rotated around it's center by it's current angle value. For ...
1
vote
1answer
71 views

XY Location scaling with varying density screens

I have a phone with resolution H=1280,W=720,Density=2 I have a tablet with resolution H=1216,W=800,Density=1.331 I drew a rectangle on my phone with corners Left,Top (-1.6,1.55), Right,Bottom ...
0
votes
0answers
44 views

Equation / formula to determine an objects position on an ellipitcal path

I'm making a space game, as such I need objects to follow an elliptical path (orbit). I've worked out how to calculate all the important aspects of my orbits, the only remaining thing is how to have ...
1
vote
1answer
79 views

Point in Polygon, Ray Method: ending infinite line

Having a bit of trouble with point in polygon collision detection using the ray method i.e. http://en.wikipedia.org/wiki/Point_in_polygon My problem is I need to give an end to the infinite line ...
1
vote
1answer
71 views

Reflection velocity

I'm trying to get a moving circular object to bounce (elastically) off of an immovable circular object. Am I doing this right? (The results look right, but I hate to trust that alone, and I can't ...
7
votes
1answer
497 views

Tessellation vs Geometry Shader

Correct me if I'm wrong, but both the Geometry Shader and the Tessellation Shader jobs are to generate vertices in the Graphic Pipeline. What I would like to know is how they are different and when ...
1
vote
1answer
229 views

Sphere-Sphere intersection and Circle-Sphere intersection

I have code for circle-circle intersection. But I need to expand it to 3-D. How do I calculate: Radius and center of the intersection circle of two spheres Points of the intersection of a sphere ...
3
votes
2answers
310 views

Find the next cell in a grid from a point and direction

I'm trying to solve a very simple problem but I'm unable to come-up with an efficient solution so far. What I'm really trying to do is voxelize triangles in a three dimensional environment but I'll ...
2
votes
2answers
100 views

Connecting two arbitrary points with 2 lines

DEFINITIONS: Any "Point (x, y)" mentioned below is really the bottom left coordinates of a 1 unit by 1 unit rectangle. A "Line" is a defined as a rectangle that is either 1 unit tall and 1 unit or ...
3
votes
3answers
337 views

Throwing a ball and estimating its path using a Physics engine

The problem: A player entity wishes to throw a ball from a known position with a known initial velocity. The surrounding environment contains physical objects that can alter the trajectory of the ...
1
vote
1answer
67 views

Calculate diameter of sphere large enough to encompasss a frustum

I'm attempting to speed up box-to-box collision checks by first testing if two spheres large enough to encompass each (respectively) would collide (because I'm using separating axis theorem and it's ...
1
vote
2answers
166 views

Find closest point from an origin, in a mesh

I want to do something similar to a raycast. With a raycast, you can set an origin and a destiny, and check where the ray collides with something but only with a line. What I want to do, is given an ...
1
vote
1answer
218 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
0
votes
2answers
1k views

How do I add an image inside a rectangle or a circle in JavaFX?

Suppose we have a rectangle called r Rectangle r = new Rectangle(40, 20); and an image called image Image image = new Image("...src for image"); How do I fit the image inside the rectangle? ...
2
votes
2answers
92 views

How can I test if a point is behind a polygon in 2D?

In order to improve the performance of my visibility graph generator I am trying to figure out the following. Given the image below; is there a way to find out if a point is 'behind' the polygon? For ...
8
votes
1answer
845 views

How can I project a 3D point onto a 3D line?

Let's say I have a line defined by two points, A and B, both in the form (x, y, z). These points represent a line in 3D space. I also have a point P, defined in the same format, that isn't on the ...
0
votes
0answers
160 views

Calculating intersection of line segment with view frustum

I want to calculate the intersection of a line segment with the view frustum. Here's what I tried so far. The code works perfectly when the look direction vector is orthogonal to the line. E.g. ...
0
votes
0answers
61 views

Rasterizing euclidean planes

I'd like to visualize a BSP tree. To do this, I need to project an arbitrary euclidean plane onto a projection plane. I was thinking about calculating the intersections of the plane with the viewing ...
3
votes
1answer
263 views

Converting between Spiral Honeycomb Mosaic and axial hex coordinates

There seems to be quite a lot of logic in dealing with hexagonal grids using a system of axial coordinates like the one described here. In doing some reading about hex grids, though, I ran across the ...
0
votes
1answer
45 views

Best method for selecting points from a point set - path distance

having a big set of points and a polygonal path what is the best way to select a set of points that are at a certain distance or smaller from the path? Or do I need to iterate thru all points on each ...
0
votes
0answers
48 views

Java Angle Math: Calculate how near the player looks to an entity [duplicate]

I am programming a Minecraft Bukkit plugin and need a way to calculate an input number from 0 to 360 for displaying a custom compass / radar. So if the player directly looks at the object (shouldn't ...
9
votes
1answer
583 views

How do I make a curved surface out of rectangular blocks?

For a Peggle-like game, I want to make blocks that follow a curve, like this: The blocks would then disappear as the ball hits them. I managed to draw some horizontally, but I'm having trouble ...
1
vote
2answers
141 views

Calculate shadow map to overlay hidden line-of-sight things in 2d?

Given a 2D sideview with even-sized grid squares and our hero in a known center-ish position like this ... and imagining this hero's line of sight like this... how could one get the point values ...
-2
votes
2answers
587 views

Convert atan2 value to standard 360-degree-system value [duplicate]

Lets say I'm using atan2 to get the angle between two vectors. atan2 gives a value in radians. I convert it to degrees using a built in function in Java. This gives me a value between 0 and 180 ...