# Display dynamic texture image on inside of sphere

I'm displaying a ring wherever the camera 'looks'. When the camera faces the ground (green) the ring image always looks correct, see image:

However, my scene is within a sphere (purple)... and when the ring reaches the sphere it does not display correctly. See image:

This second image, the ring should be facing the camera since it's on a surface that is in front of the camera (not on the ground like the image appears).

Sorry if my images are poor representations. I basically have a flat plane which is within a sphere. The sphere has flipped normals to be able to display from within the sphere. I need the ring to "attach" or bend to the shaped of the object it is being drawn against. Any help is greatly appreciated.

EDIT: (more details). You can't raycast to a collider from within the same collider, so I'm using a raycast in the opposite direction. Code:

Ray ray = new Ray(m_Camera.position, m_Camera.forward); // get ray
Vector3 forwardVector = ray.GetPoint(100); // get a point 100 away
ray = new Ray(forwardVector, m_Camera.forward); // create new ray from this point
ray.direction = -ray.direction; // reverse ray direction
if (Physics.Raycast(ray, out hit, m_RayLength, ~m_ExclusionLayers)) {
imageTransform.rotation = Quaternion.FromToRotation (Vector3.forward, hit.normal);
}

• Have you tried simply rotating the ring to be perpendicular to the view vector? May 30, 2018 at 1:03
• Thanks for the quick reply. I'm still very new (especially the math) so bare with me. Right now I am doing this: imageTransform.rotation = Quaternion.FromToRotation (Vector3.forward, rayhit.normal); Note that my rayhit is coming in the reverse direction. Long story short you can't raycast to a collider from within the collider itself, so I'm picking a point outside the collider (sphere) and casting inwards towards my camera. May 30, 2018 at 1:09
• If you want to share code or details about your current method, use the edit link to add it into your question itself. You get better formatting that way. May 30, 2018 at 1:10

Target.transform.position = hit.point;