The 2024 Developer Survey results are live! See the results

# Questions tagged [sphere]

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

85 questions
Filter by
Sorted by
Tagged with
69 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 ...
• 13
1 vote
206 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" ...
• 13
90 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 ...
70 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 ...
102 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 ...
• 47
107 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 ...
• 141
135 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 ...
• 47
1 vote
548 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, ...
• 47
136 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 ...
• 47
1 vote
929 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 ...
67 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 ...
• 1
857 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 : ...
1 vote
8k 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 ...
233 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 ...
• 21
100 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
702 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....
624 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
333 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 ...
• 111
459 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
145 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
262 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) ...
• 1,126
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
279 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 ...
• 121
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 ...
• 143
186 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 ...
• 171
697 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
224 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 ...
• 1,126
120 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. ...
• 1
110 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 ...
• 1
188 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 ...
732 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
449 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 ...
• 771
1 vote
437 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 ...
• 11
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 ...
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 ...
704 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
708 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 ...
155 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 ...
• 586
323 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 ...
• 586
1 vote
326 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 ...
• 586
501 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) ...
• 105
210 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 ...
• 105
1 vote
9k 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 ...
2k views

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 ...
• 131
1 vote
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 ...
• 243
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 ...
• 11
2k 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 ...
315 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 ...
1 vote