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
1answer
87 views

How can I find a position between 4 vertices in a fragment shader?

I'm creating a shader with SharpDX (DirectX11 in C#) that takes a segment (2 points) from the output of a Vertex Shader and then passes them to a Geometry Shader, which converts this line into a ...
4
votes
2answers
293 views

a flexible data structure for geometries

What data structure would you use to represent meshes that are to be altered (e.g. adding or removing new faces, vertices and edges), and that have to be "studied" in different ways (e.g. finding all ...
2
votes
1answer
154 views

Why is there high performance hit with many meshes?

I am currently reading upon Geometry Instancing, as I want to render a lot of animatable objects on the screen. However I have come to a more fundamental question first: Why do I even need to use it? ...
0
votes
2answers
2k views

How to determine the point of intersection of two lines? [closed]

I have two lines say P1( 0, -1, 0, -1 ) and P2( -1, 0, 0, -1 ). Since I'm working in 2D, there is no Z component. The x,y,z components are normals and the w component is the distance from origin. I am ...
4
votes
2answers
385 views

Allowing a player to walk up and down slopes without resistance

I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them ...
1
vote
0answers
325 views

Geometry shader and triangle adjacency

I'm currently trying to change my project to use GL_TRIANGLE_ADJACENCY instead of GL_TRIANGLES. Following this question, I have managed to construct my index buffer fine, but when it comes to the ...
2
votes
1answer
72 views

GL_TRIANGLE_ADJACENCY and glDrawElements

So I've not been able to find much online about how data should be stored for triangle adjacency. Currently I calculate my adjacent using half-edges (mention in an answer here). But do I store this ...
2
votes
2answers
89 views

Decomposing a collision grid into a set of boxes

I'm looking for a decent algorithm to decompose a collision grid (e.g. bool[w,h])... ...into a non-overlapping set of boxes (e.g. List<Rectangle>). The solution does not have to be the ...
1
vote
1answer
763 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?
1
vote
1answer
223 views

Batching and performances

I'm trying to understand batching and I'm not sure to understand how to do that, can I have more informations please? Here is what I found for the moment: Batching informations There is many types ...
10
votes
2answers
452 views

World Bounds - (0, Size) or (-HalfSize, HalfSize)?

When creating a game space in which to move, draw and collide objects, is it better to have the (0,0) point, or the (0,0,0) point, be in the very center of your space, such that the bounds of the ...
9
votes
4answers
364 views

How can I find the largest sphere that fits inside a frustum?

How do you find the largest sphere that you can draw in perspective? Viewed from the top, it'd be this: Added: on the frustum on the right, I've marked four points I think we know something about. ...
7
votes
3answers
558 views

How do I target a tank turret with an offset barrel?

I have a tank model consisting of multiple parts, a body, a turret and the barrel of the gun. The turret is offset from the body origin and can rotate around the Y axis(up). The barrel is connected to ...
0
votes
1answer
237 views

DirectX 11, using Tessellation & Geometry shader in a single pass

Before all, sorry for my poor english ! With DirectX 11, i'm trying to create a random map full with GPU. Using Hull shader stage, I'm managing LOD with tessellation. Using Domain shader stage, I'm ...
1
vote
1answer
83 views

Which Graphics/Geometry abstraction to choose?

I've been thinking about the design for a browser app on the HTML5 canvas that simulates a 2D robot zooming around, sensing the world around it. I decided to do this from scratch just for fun. I need ...
5
votes
1answer
189 views

A* search in hexagonal grid with minimum turn radius

I need to run an A* search through a hexagonal grid. However, I have one nasty constraint: my vehicle can only turn so sharp. It has a specified minimum turn radius. I can't quite see how to translate ...
3
votes
1answer
111 views

Vertices shaking with large camera position values

Basicly when i set the position of my camera (my character in game) to a high value, the geometries seems to be shaking, the higher the position value, the more they shake. On low position values you ...
0
votes
1answer
107 views

“Walking” along a rotating surface in LimeJS

I'm trying to have a character walk along a plank (a long, thin rectangle) that works like a seesaw, being rotated around a central point by box2d physics (falling objects). I want the left and right ...
23
votes
4answers
2k views

Is the Manhattan distance monotonic when used as heuristic function?

I have a square-based map. Only horizontal and vertical movement is allowed (no diagonals). Movement cost is always 1. I'm implementing an A* algorithm on that map, using the Manhattan distance as a ...
2
votes
2answers
146 views

Calculating specific coordinate along a path

Let's say I have a path comprised of a sequence of points that are connect by lines and arcs. The entire path has some specific length. Let's call that length 100. What would be the mechanism to ...
2
votes
1answer
508 views

Collision avoidance (AI)

Now my 3D model has complete AI behaviours, but my model has no collision avoidance while he is moving towards the player! Because of this, he gets stuck in front of 3D blocks sometimes. I think the ...
6
votes
1answer
671 views

Procedural Geometry Generation

I have recently been looking into SceneKit for OS X and noticed that there are several factory methods to create geometric shapes such as: Box, Capsule, Cone, Cylinder, Plane, Pyramid, Sphere, Torus ...
0
votes
1answer
210 views

enemy View Range , chase player

for 3D: Q1 : I want to make zone range for each enemy in the game , so that when the player in the view range he will be chased . Q2 :if I want to make enemy walk a little bit around his position ...
-1
votes
1answer
116 views

chasing , zone range

here is an image show what I am gonna to do in my XNA game , I want to check if the player is inside zone range and if yes then attack the player , I tried to do this using checking ray but it's odd ...
28
votes
6answers
2k views

Hexagon collision detection for fast moving objects?

A object has a position and a speed vector. Usually only the position is used to check if two objects collide, this is problematic for very fast moving objects as it can happen that the object moves ...
1
vote
0answers
51 views

Blender: calculation of elevation and rotation angle from plane

I have a generic plane (any location, any rotation around every axis) with its normal axis passing by the center. Then I have a generic point and I need to find the elevation and the rotation angle ...
0
votes
1answer
190 views

Issues with Sine Wave Generation and Rotation

I'm working on generating objects in sine wave that lets you specify parameters that are start x, end x, start y, and end y position. Below is the method that I used to generate the debris void ...
3
votes
2answers
167 views

What kind of projection is ScreenX=X/Z, ScreenY=Y/Z?

I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library. To project a single vector (X,Y,Z) ...
1
vote
2answers
345 views

DirectX How to Gernerate Vertices for Diamond Shape and Render it?

How to generate vertices for 3D Diamond Shape in DirectX? EDIT: I am creating an application which receive DIAMETER, CROWN, GIRDLE and PAVILION as parameter and render a model of diamond according to ...
2
votes
1answer
403 views

Decomposing a concave mesh into a set of convex meshes

I'd like to be able to decompose a concave mesh into a set of convex meshes for 2 reasons: Transparent rendering Physics shapes Is there an algorithm that takes a set of triangles (concave) as ...
4
votes
2answers
946 views

Displaying (3D) objects' name above them

The Elder Scrolls: Morrowind has a rather interesting way to display each focused objects' name. It's all a bit fuzzy in my memory right now, but the most important part I remember perfectly: the ...
1
vote
1answer
136 views

A controlled trapezoid transformation with perspective projecton

I'm trying to implement a controlled trapezoid transformation in Adobe Flash's ActionScript using the built-in perspective projection facility. To give you an idea of how the effect looks like: ...
2
votes
0answers
152 views

How to trace contour of shapes with holes?

I am experimenting with the RVO2 library for collision avoidance in a 2D simulation. This library supports specifying arbitrary obstacles as a list of vertices. The obstacles must be full shapes, i.e. ...
2
votes
1answer
227 views

Moving an object toward another object on sphere knowing their quaternions

I have a sphere centered in world origin. On the sphere surface I have two objects and I know their quaternions (rotation around sphere). Currently my movement works on Vector2 inputs (cannot change ...
0
votes
1answer
603 views

Rotation of Rectangle along Y-axis transformed to parallelogram

After the rotation of a rectangular view along the Y-axis, about its center, transformed into parallelogram, how do I get the rotated parallelogram coordinates? By Y-axis, I mean perpendicular to the ...
1
vote
3answers
182 views

Geometry problem for area of sight

My player have a line of sight and all objects between the white lines, turns red. To compute this, the following conditions are met: if the angle between the yellow line and the red line are small ...
-5
votes
3answers
344 views

in the shadow of a sphere [duplicate]

(Related, but somewhat different, to my previous question) How can I determine in a fragment shader if a fragment is in the shadow of a sphere? That is, if it is occluded by the sphere and is past ...
1
vote
1answer
67 views

Build a Cube/Prism from other varied Cubes/Prisms [closed]

I'm wondering, are there any algorithms or theories in existence (that aren't patented/proprietary/protected) that would take a series of 3d rectangular prisms (or cubes but a cube is a prism) and ...
2
votes
1answer
523 views

How to calculate collision normal between two AxisAlignedBox's?

I'm writing a physics simulation in Ogre3D and I'm trying to figure out how to calculate the collision normal between two Ogre::AxisAlignedBox's. I am checking for collisions using the "intersects" ...
3
votes
1answer
452 views

How do I render a filled and stroked path using OpenGL?

I want to render a 2-dimensional geometric path consisting of B├ęzier curves and straight lines. Paths can be concave. What is the most efficient way to draw this using modern OpenGL? Can I do this ...
0
votes
1answer
42 views

How to linearly blend between multiple points, deviating from a default point?

I have a set of 3D points that I need to "blend" between. Lets say I have points [A,B,C] and I have the amount I want to blend each as [0.5, 0.2, 0.8], how can I blend between these points with the ...
1
vote
1answer
105 views

How to linearly “blend” between multiple 3D points?

I have a set of 3D points that I need to "blend" between. Lets say I have points [A,B,C] and I have the amount I want to blend each as [0.5, 0.2, 0.8], how can I blend between these points with the ...
6
votes
3answers
563 views

Transforming a primitive tetrahedron into a primitive icosahedron?

I've created a tetrahedron by creating a BoundingBox and building the faces of the tetrahedron within the bounding box as follows (see image as well): VertexPositionNormalTexture[] vertices = new ...
8
votes
6answers
1k views

How do I calculate distance from a point to a rectangle?

I have a 2D rectangle with x, y position, height and width, and a randomly positioned point nearby. Is there a way to check if this point might collide with the rectangle if it is closer than a ...
24
votes
1answer
2k views

How do you turn a cube into a sphere?

I'm trying to make a quad sphere based on an article, which shows results like this: I can generate a cube correctly: But when I convert all the points according to this formula (from the page ...
2
votes
2answers
116 views

Splitting Graph into distinct polygons in O(E) complexity

If you have seen my last question: trapped inside a Graph : Find paths along edges that do not cross any edges How do you split an entire graph into distinct shapes 'trapped' inside the graph(like ...
5
votes
1answer
132 views

trapped inside a Graph : Find paths along edges that do not cross any edges

This is a graph based platformer level and the round shapes are creatures. I am looking for a path traveling along edges that does not cross other edges(To simulate the creature crawling on the ...
1
vote
2answers
2k views

Rotate an object given only by its points?

I was recently writing a simple 3D maze FPP game. Once I was done fiddling with planes in OpenGL, I wanted to add support for importing Blender objects. The approach I used was triangulization of the ...
2
votes
1answer
156 views

Finding the normals of an oriented bounding box?

Here is my problem. I'm working on the physics for my 2D game. All objects are oriented bounding boxes (OBB) based on the separate axis theorem. In order to do collision resolution, I need to be ...
18
votes
5answers
671 views

Moving CW or CCW?

Lets say we have a jagged shape: And two creatures moving along it's outline. Then we smooth the shape completely by pulling the corners out. We get this: It is easy to see now that Orange is ...