# Primitive shapes whose parameters are dependent on their relative postiton

Fist time posting. I love Blender (a hobbyist new user making stills and stuff) but if it is not the right software, feel free to send me off.

I'd like to have a sphere and a cone whose base is formed of the tangent points of the rays cast from the cone's tip to the sphere, depending on how far the cone's tip is from the surface of the sphere. In other words, the cone would always depict a visual horizon of the sphere: approaching it's half and an infinitesimal angle as the distance goes to infinity, and an infinitesimal radius and a 180 degree angle as the distance approaches zero. I would then be able to keyframe the distance to create an animation of how the shape of the cone changes depending on it.

• What is the formula for the radius of the base of the cone, and can you express it without using transcendental functions? Aug 10, 2020 at 20:32
• Are you envisioning the cone's height changing so it always intercepts the sphere like an ice cream cone, or being fixed in length? Aug 10, 2020 at 20:58

Here is one workflow that might get you where you want to go:

Set the 3D cursor to world origin Shift+s, 1

Create a "unit cone" with radius 1 and depth 1:

Notice Location Z is set to -0.5. This places the vertex of the cone on the origin.

Use the object menu to set the object origin to 3D cursor. Now the cone's origin is at the vertex. All scaling and rotating we will do is reference to the vertex.

Add in a UV Sphere, leave the radius at 1 for simplicity, then move it away from the cone. While you've still got the Sphere selected, add a "Limit Distance" object constraint, set the Target to the Cone, Distance to 1.1 (a little more than the Sphere radius) and "Clamp Region" to outside. This prevents the Sphere from moving too close to the Cone's Vertex. Its hard to calculate the tangent of a point inside the Sphere!

Now we need to point the Cone at the Sphere, to do that select the Cone, and press r, y, -90 to rotate it 90 degrees on the y axis. Then apply rotation. The add a "Track to" object constraint to the Cone. Set the Target to the Sphere, and Axis to x. The Cone's base should now point to the Sphere as you move the Sphere around the scene, and you should not be able to move the Sphere too close to the Cone.

Now we need to add some Drivers to the Cone: Open the Cone's Transform panel, right click on Scale X and choose "Add Driver", on the Driven Property panel, set the "Expression" to var, and under Input Variable set the type to "Distance" and the Targets to Sphere and Cone. This should make the Cone stretch to always intersect the origin of the Sphere. You can experiment with the expression to get the effect you want.

Finally, add drivers to the Cone's Scale:Y and Scale:Z properties.

The expression is

tan(asin(1/dist)) * var


Where dist is a distance variable as setup previously, and var is height of the cone, taken from "Scale:X"