Questions tagged [sphere]
A geometric primitive in which all points have the same distance to a midpoint.
89 questions
0
votes
1
answer
64
views
Is an assumption of Welzl’s algorithm valid?
The stated assertion that a point outside some intermediate Minimum Enclosing Sphere is on the boundary of the final Minimum Enclosing Sphere seems unsupportable. It is true only for the first point ...
7
votes
1
answer
1k
views
Why are collision manifold points created inside objects instead of on their surfaces?
Suppose you have two overlapping spheres \$A\$ and \$B\$, with centers \$c_{A}\$ and \$c_{B}\$ and radii \$r_{A}\$ and \$r_{B}\$. Let
\$n = \operatorname{normalize}(c_{B} - c_{A})\$ be the collision ...
1
vote
1
answer
126
views
Why is my raycast not working?
I'm trying to ray-cast mouse clicks to the surface of a sphere (from which point, I'm going to get the coordinates of the vertex of the sphere's mesh that are closest to the click). The following ...
0
votes
1
answer
113
views
Variable subdivision creating artifacts
I'm currently implementing a method for subdividing an icosahedron found here that isn't quite working as expected due to the artifacts created (and the way the triangles are oriented)
The problem ...
0
votes
1
answer
242
views
How to live on sphere?
What I want to achieve
I want to generate sphere planet world, seamless of course, for RTS game like Planetary Annihilation: TITANS, which means I want:
place walking agents on sphere, move them on a ...
1
vote
2
answers
314
views
Seam visible on sphere or torus made in Blender when using a texture atlas
I'm making a game in OpenGL with C++.
I have a problem with my vertices or texture coordinates - there's a seam visible on the sphere where the texture wraps around:
If I use "nearest" ...
0
votes
1
answer
179
views
How do I determine which pixel is under the cursor when looking at an equirectangular image through a camera?
I am working on a game. The camera is freely rotatable by the user. The background is displayed from an equirectangular image. I need to know which pixel of the background image is located under the ...
0
votes
0
answers
122
views
How to fix distortion when wrapping heightmap around sphere
I currently have a 3D model of the moon. You are able to pick a point on the moon and it takes longitude and latitude coordinates of that point and generates a mesh based on the heightmap. So if you ...
0
votes
0
answers
146
views
Why are there gaps in my fibonacci sphere?
I recently took an interest in sphere topologies to find which one is the best. The most popular one seems to be the fibonacci sphere. So I went and did some research and found some C code online that ...
0
votes
1
answer
166
views
How to compute visible area of a sphere
I have a number of spheres in my scene. I also have another object that I want to scale depending on the amount of a selected sphere that is visible (it can be occluded by multiple other spheres ...
0
votes
1
answer
203
views
How to scale down noise intensity?
I'm currently making a planet and for that, I added noise, to create terrain on the surface. The method I'm using is creating simplex noise (that ends up looking like the image below)
And I write ...
1
vote
1
answer
769
views
How to subdivide an octahedron into a sphere?
For a game I'm making, I have to tessellate an octahedron into a sphere on the GPU (shaders). What I've done is I've successfully tessellated the faces, but I'm having trouble subdividing more spaces, ...
0
votes
1
answer
202
views
Help understanding the math to position sphere vertices by latitude and longitude
For a project of mine, I need to render spheres without loading a pre-made model or using built-in functions.
I found this bit of code on the internet that seems to work but I really want to ...
1
vote
1
answer
1k
views
Cube Mapping vs Spherical Mapping
I am currently researching the difference between Cube Mapping and Spherical Mapping.
Wikipedia says the following:
In the majority of cases, cube mapping is preferred over the older method of sphere ...
0
votes
1
answer
108
views
How would I calculate the velocity of a sphere with an impulse applied at the top?
I'm developing a rigid body physics engine and currently have accurately calculated the angular velocity of the sphere when impulsed. Unfortunately though, I'm not calculating the velocity correctly ...
0
votes
0
answers
946
views
Unrealistic billiard ball movement
So, I have this problem, even when I apply a small amount of force, the balls seem to get pushed away easily. Here's how they should behave (GIF from 8 ball pool game):
And here's how I have it :
...
2
votes
1
answer
10k
views
How can I correctly map a texture onto a sphere?
I'm trying to make a 3d model of the Earth (it doesn't have to be a fully-accurate geoid), but whenever I try with a map as a material's albedo to do so, it looks kind of weird and wonky. I assume ...
2
votes
0
answers
319
views
Finding points on a face of an icosphere
I am working on a game the ultimately will be a tactical game on the surface of a sphere. To model the surface of a sphere I have chosen to use an iterated icosphere, where each face is iterated quite ...
0
votes
0
answers
146
views
Sphere-ring collision detection
I'm making 3d basketball throwing simulator and I'm stuck with the sphere-ring collision detection.
It's easy to find the collision normal if we have the collision point with the ring, but I don't ...
1
vote
1
answer
884
views
Seam on UV Sphere [duplicate]
I created a uv sphere model in Blender, and I'm loading it as an obj into my OpenGL game. I'm attempting to model a 2d image as a texture for this sphere to make the moon, but I've run into this issue....
0
votes
2
answers
749
views
Generate vertices of a sphere by using spherical coordinates
I'm trying to generate points for a sphere by subdividing the space of spherical coordinate in res sector and res slices.
At first I did my own implementation, but it wasn't working. After a while I ...
1
vote
1
answer
501
views
Domain distortion on a spherical texture (planetary surface)
I am experimenting with procedural techniques to generate planetary terrain. I have close to zero knowledge so I started with something simple, using perlin noise and domain distortion.
My goal is to ...
2
votes
1
answer
564
views
How to calculate trajectory on a planet with drag factor
I'm curious what is the valid calculation of a projectile trajectory in case when:
surface is not flat but spherical like a planet
drag is enabled (for example 0.1)
and we are in 3D
I've found ...
1
vote
0
answers
185
views
Proper sphere collision resolution?
I am implementing a sphere to sphere collision resolution and I am a little confused on where to start. First question, is there a standard way that games/engines do sphere to sphere collision ...
1
vote
1
answer
377
views
Fragment shader - map dot texture repeatedly over the sphere
I have a sphere and in Fragment shader, I have available lat / lon position (in radians) for every fragment. I have a texture of a single dot. I need to map this single dot (or any other texture) ...
0
votes
1
answer
2k
views
Find random point on a circle with a radius of x and the players position as center (unity)
First of all please note that the game is in 3d and Not 2d
The image below is seen from above. What I am trying to do is find a random point 2 - 3 meters around the player.
However I am not quite ...
1
vote
1
answer
325
views
Calculate UV sphere vertices (altitude)
There is an fantastic answer by DMGregory here where he explains how to calculate and generate the vertices of an UV Sphere: OpenGL calculate UV sphere vertices
Based on his code, how can we change ...
0
votes
1
answer
1k
views
How do I get the size of a Plane in pixels and set it multiplied by some factor to be the size of a Sphere?
I am doing an attempt to make a 3D snake game, as an experiment but I am still a beginner. I have a Sphere that I wish to dynamically resize to be, let's say, the ...
0
votes
0
answers
214
views
Latitude and Longitude to Vector3 Not Aligning
I am trying to align a marker sphere to certain places on a bigger Earth sphere based on the inputted latitude and longitude.
The following is my code for this conversion, this code is based on the ...
0
votes
2
answers
967
views
How to form a sphere from Voxels
I want to form a Sphere given radius from blocks given size. And can't figure out the code / algorithm. Any help appreciated.
Edit: I dont wan't the Sphere to be filled, just the outer shell
Edit: ...
1
vote
1
answer
280
views
Tiles on sphere - check visibility
I have a sphere with tiles. I need to check if a tile is visible or not. See the image. Tiles are red squares, "screen" is represented by yellow quad.
Currently, I calculate coordinates of ...
0
votes
2
answers
161
views
The camera goes up and down when following a rolling sphere
I have this CameraController script attached to my camera, to follow a sphere that moves using WSAD.
...
0
votes
1
answer
135
views
Assigning relative force to a projectile fired while orbiting a sphere
Projectile Not Correctly Inheriting Parent Velocity (Unity3D)
So I am trying to incorporate the above person's changes into a script I am making although
I'm no great coder and
I'm not even sure ...
0
votes
1
answer
225
views
How would I move something around inside of a sphere without it going outside of the sphere?
I want to be able to do this, but not go outside of the 4.4 meter limit, the radius is 4.4 meters, and it has zero gravity and no friction. I have a hard time explaining this, but imagine holding a ...
0
votes
1
answer
872
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 ...
1
vote
0
answers
534
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 ...
2
votes
1
answer
511
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 ...
3
votes
2
answers
3k
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 ...
3
votes
2
answers
3k
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
1
answer
746
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
2
votes
1
answer
763
views
Rotating a sphere so point lines up with the camera
I'm trying to make a world map in Unity that contains a rotating globe with landing sites on the perimeter. What I want is that when a player clicks on the landing site the globe rotates so that the ...
0
votes
1
answer
201
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
1
answer
381
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
1
answer
372
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
2
answers
569
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
1
answer
262
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 ...
1
vote
1
answer
10k
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 ...
5
votes
1
answer
2k
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
1
answer
1k
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 ...
-2
votes
2
answers
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 ...