Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sphere]

A geometric primitive in which all points have the same distance to a midpoint.

0
votes
0answers
44 views

Unity: AddForce problem

I have two spheres on a plane. I'm applying AddForce to the first ball after which it collides with the second one. The weird thing is that the impulse is not passing from the first ball to the second ...
0
votes
1answer
44 views

how to use 2D noise with a voxel sphere

I have a bunch of voxels, lets just say 64x64x64, that I use to create a sphere/planet. This works very well, but once I try to apply noise to create a more interesting terrain things go wrong. 3D ...
0
votes
1answer
66 views

How can I get visually accurate collision normals with sphere collisions?

I'm solving simple 3D sphere collisions by checking the sphere for overlap with a mesh, finding the nearest point on that mesh's surface to the center of the sphere, and then resolving the collision ...
1
vote
1answer
111 views

I don't understand code that builds 3D sphere

I'm trying to learn some lwjgl and opengl, and I was trying to make a 3d sphere etc, I found a code to do that, but I don't 100% understand the code and the math behind it and would like to get some ...
1
vote
2answers
192 views

Getting the bounding box of a sphere

I have a sphere with values center,radius and I need to convert the sphere to a bounding box with values min,max. How do I ...
2
votes
2answers
326 views

How can I generate the smallest enclosing sphere from a mesh?

I have a polygon which is defined by a set of vertices and I need the smallest sphere encompassing the mesh. The spheres are defined by a position vector (x,y,z) and a radius. Is there an algorithm ...
0
votes
1answer
86 views

Finding the contact point of two spheres

Is there a way to get the normal and depth of two spheres that have collided. I know that it is something to do with the center and radius of two spheres but I am not sure what
0
votes
1answer
46 views

Bullet direction incorrect around sphere

Here is a little background on how my game objects are set up, and how the rotations and firing bullets work. I am working on this game in Unity. I have two game objects that orbit a sphere (for ...
0
votes
1answer
58 views

Make object face another object on a sphere

I have a game I'm working on in Unity where there are two objects on a sphere at random locations (and random rotations). I want one of the objects to always rotate so that if it were to fire a bullet ...
1
vote
1answer
68 views

Direction between objects (shortest distance around sphere)

I have two objects rotating around a sphere. One is controlled by the user (object A), another is simulating a user but controlled by the computer (object B). At random intervals of time I'd like ...
2
votes
2answers
60 views

How can I move a 3d object to a known Cartesian point on the surface of a sphere?

I'm trying to figure out how to move an object from one Cartesian point to another located on the surface of a 3D sphere. So that the object will follow the spherical coordinate system (Theta and Phi) ...
0
votes
1answer
95 views

Moving 3D object over Spherical terrain

I'm trying to control a 3D object (just a box for the moment) moving over a spherical 3D planet, I'm using a Ray to find the triangle in the sphere under the object. I'm calculating the surface normal ...
0
votes
1answer
2k views

OpenGL calculate UV sphere vertices

I am trying to implement a class Sphere in C++. Therefore I want to calculate the vertices in the constructor of the class (or in a seperate function..). Although ...
3
votes
1answer
460 views

Quad sphere subdivision algorithm

I like to generate some planets like Kerbal Space Program does. By some videos of the developers I know that they use a quadsphere, which consists of six “entities” as a minimum. These are all plane ...
1
vote
1answer
303 views

Calculating the latitude & longitude of a raycast hit point on a sphere

I am working on a game where you look at a sphere and get the latitude and longitude of the position. I get the position on the globe with a raycast along the direction the user is looking. Using ...
-3
votes
2answers
1k views

Describing the spherical cap intersection between a spherical shell and a solid ball

I have: an infinitely thin sphere shell with center O1 and radius R1, and a solid ball with center ...
6
votes
2answers
433 views

Imitate a textured sphere in 2D

I'm writing planet generator, using pico8. I got surface generation done: And the last thing to do is to map the texture onto a sphere. Pico8 has no triangle function. So my question is, how do I ...
0
votes
1answer
100 views

Raycast Movement on a sphere

so I'm working on a mobile game where I have touch input from a Asset from the asset store. It all works perfectly fine, except for one thing: I want to implement a "drag and drop" feature so when I ...
0
votes
0answers
249 views

How to draw grids on a sphere?

What is the common method for drawing grids on a sphere in DirectX, as it was done in a map of the globe. The following problems are concerned. How to draw grid lines? Grid lines, the longitudinal ...
0
votes
1answer
643 views

Converting back and forth between spherical and cartesian coordinates in glsl

I have checked all the possible resources and I still don't know why my code is not working. This code should convert uv (texture coordinates) or cartesian into spherical and back. But my code still ...
0
votes
1answer
149 views

Ball bounce in 3d

I cannot get my bounce equations right. I have 2 spheres, that can colide at any angle. One is forever stationary, other one is moving though the space. I have X,Y,Z speed of the moving ball and a ...
1
vote
1answer
457 views

3D sphere generation

I have found a 3D sphere in a closed-source game engine that I really like the look of and would like to have something similar in my own 3D engine. This is how the sphere looks like when it is ...
1
vote
0answers
44 views

Convert box to matrix

I have a box (non-rectangular cuboid?) and would like to convert it to a matrix such that when a point inside the box is multiplied by the matrix, a vector is returned that describes the relative ...
1
vote
2answers
2k views

How can I create a “wireframe” texture for a sphere in SceneKit?

I've been struggling to figure this out. I would like to have a sphere in SceneKit that looks like this: I think the easiest way would be to create a mostly transparent texture with the wireframe ...
3
votes
1answer
295 views

Unity API - Making a Sphere Jump?

I'm making a very simple game with a sphere that's supposed to roll and bounce on "planets". Also, please be ready to read a lot. I want to be very descriptive for you. :) I've pretty-much-done ...
10
votes
1answer
872 views

Draw the middle half of a sphere programmatically

I'm trying to create the middle half of a sphere. Basically to create a sphere, stack numbers and slice numbers are given, and there are two variables phi (for ...
0
votes
0answers
50 views

sphere to sphere interpolation

I am at the moment trying to come up with an scheme that interpolats between a current state and a desired state. Each state consist of an 3d coordinate and a rotation matrix, orienting an camera ...
1
vote
2answers
383 views

Unity3D - Determining if a spherical object is grounded using raycast

I'm making a game revolving around moving a ball around a space. My game has a jump mechanic, so I need to know when I'm grounded in order to determine when I'm able to jump. Best way to check this is ...
2
votes
1answer
41 views

Returning a List of coords for a sphere in order of inside to outside

I'm looking for any algorithm that can return a list of Vector3 coordinates that form a sphere. If you read the list from the beginning it would appear the sphere was expanding. The only algorithms ...
9
votes
0answers
887 views

How do i find the circumsphere of a tetrahedron?

I'm looking for the most minimized equation to find the center coordinates and the radius of a tetrahedron circumsphere given four 3D points. What I found on the internet mainly deal with the circum ...
0
votes
0answers
89 views

Ball movement simulation

I'm doing a little demo with scene kit and i want to simulate the rotation of a ball on a table. How can i achieve this? This is the scene that i prepared:
13
votes
4answers
3k views

How to load a spherical planet and its regions?

I'm designing a game partially composed of planets exploration. I want to use pseudo-random generation for them, regenerating from a defined seed when I have to load them rather than store every ...
7
votes
1answer
195 views

How can I keep the clicked point under the mouse when rotating? (GLM)

I have a spherical mesh of radius 1, centered at (0,0,0) in world coordinates. I want to rotate the sphere so that the clicked point remains under the mouse at all times. However, I cannot find an ...
-2
votes
1answer
340 views

how to rotate a sphere around centre (x y z) [duplicate]

I have centre of sphere at x y z. now I want to rotate any point (a b c) on the sphere about centre. how can I do it in c++.
1
vote
0answers
2k views

How to fix artifacts when using equirectangular 360 panorama photo on sphere

I have a equirectangular 360 panorama photo. I tried to use it as a texture for a default Unity Sphere. The image had artifacts/visible seams, especially near the "poles" of the sphere (north pole and ...
2
votes
2answers
3k views

How do I wrap an image around a sphere?

Ideally I'd like a reference of the math involved, so I can start breaking down the problem. The simplest thing I can deduce about this problem is that the part of the sphere that the user is ...
0
votes
0answers
766 views

How to slow down a Sphere smoothly in a world controlled by force and stop it (Unity 5)?

I am a beginner and I started to use Unity 5. I play with tutorials on the site and documentation. I was basically testing springs, physics materials etc. I have a problem understanding probably a ...
2
votes
0answers
114 views

Zoom to Mouse on a Globe using a Perspective Projection

I am trying to create a strategy game that takes place on a globe (i.e. a textured sphere). I would like to be able to zoom to mouse like on google maps. My camera always points towards the center of ...
-1
votes
1answer
918 views

Marching Cubes Chunks

I'm doing some voxel based game, where I want to have voxel planets. I decided to use the marching cubes algorithm, and I successfully created a planet (even with noise) with the following density ...
5
votes
1answer
2k views

Voxel (Marching Cubes) Terrain Creation / Terrain Editing

im working on a voxel based game in unity. the terrain(sphere-->planet) should be out of voxels and at first i built a minecraft like voxel plugin for unity. this means that i had a sphere out of ...
2
votes
1answer
235 views

Get quaternion between two objects on sphere

In a planetary gravity environment objects are represented in the following way: ...
4
votes
4answers
2k views

How do I resolve a sphere-triangle collision in a given direction?

I am trying my hand at game physics. I understand that the basic way to pull back a sphere when it collided is to negate the penetration distance: ...
0
votes
0answers
725 views

OpenGL - using gluSphere

I have an OpenGL code that currently draws several spheres at different locations. I generate the vertex buffer data (and normal data) myself. However, to simplify the code and increase efficiency, I ...
5
votes
1answer
6k 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 and ...
3
votes
1answer
2k views

How to project spherical coordinates to canvas

I have objects with coordinates in a spherical coordinate system (altitude alt and azmiuth az). I want to project those to my canvas with a given size (128 x 128 pixels²) and resolution (about 6 px/°)....
2
votes
2answers
302 views

Sweep collision between two moving spheres?

Say I have a scenario like this: Here I got two spheres (sphere A and B) that moves from on spot to another during a frame. How can I predict where these two collide if they collide at all? In ...
1
vote
1answer
115 views

Camera Aligned To Sphere Surface

I am writing a planet renderer and have come across a problem that is really limiting the usability of the program. When I am on the planet (anywhere but the north pole) I cannot rotate the camera to ...
1
vote
2answers
1k views

Tangent on generated sphere

I have difficulties understanding the tangent/bitangent concept for normal mapping, or rather the calculations of them. I draw a sphere which is generated with the code in the OpenGL redbook http://...
12
votes
6answers
29k views

How to change Gravity towards certain object in Unity?

I have two spheres in Unity. One is 1000x in size other is 1x in size. So I want the smaller sphere to be attracted to bigger sphere. So how do I do it. I know that it can be down through gravity ...
2
votes
2answers
2k views

OpenGL texture on sphere

I want to create a rolling, textured ball in OpenGL ES 1.0 for Android. With this function I can create a sphere: ...