# Intersection of vector and surface

This topic is 4112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, This isn't really a game-related question, but it seems to be related enough to the concepts of collision detection and the like that some members here might be able to help me out with. The problem I'm trying to solve is this: I have a surface that is roughly spherical (though not exactly), defined by a number of points (typically around 110,000, but can be anywhere up to 1,048,576) in 3D space. I also have a collection of uniformly-spaced unit vectors located across a plane. I want to find the intersection between each vector and the surface. The accuracy of the location of the intersection is critical, so I'd prefer not to use an approximate method (like reducing it to a sphere), but would prefer simplicity over complexity for identical results. Speed is not critical, since this is a one-time operation (which I then use to build a lookup table for runtime), but it would be nice if it didn't take 3 weeks like my current method. Where should I be looking? Can anybody give me some pointers on how this should be done? Any help would be greatly appreciated!

##### Share on other sites
Quote:
 Original post by salmonsolidThe problem I'm trying to solve is this: I have a surface that is roughly spherical (though not exactly), defined by a number of points (typically around 110,000, but can be anywhere up to 1,048,576) in 3D space. I also have a collection of uniformly-spaced unit vectors located across a plane. I want to find the intersection between each vector and the surface. The accuracy of the location of the intersection is critical, so I'd prefer not to use an approximate method (like reducing it to a sphere), but would prefer simplicity over complexity for identical results. Speed is not critical, since this is a one-time operation (which I then use to build a lookup table for runtime), but it would be nice if it didn't take 3 weeks like my current method.

1. How exactly do the points define the surface? Is the surface triangulated? Or are the points just 'floating in space' in a configuration that happens to approximate a sphere?

2. What do you mean exactly by 'unit vectors located across a plane'?

This might be just me, but I usually have an easier time thinking about a problem if I know what the problem actually is, rather than having to put the pieces together from an abstract description. Would it be possible to describe the problem more specifically, or at least provide some more information about the context?

##### Share on other sites

Ray Object Intersections

##### Share on other sites
Quote:
 Original post by jykI'll go ahead and ask a couple of questions:1. How exactly do the points define the surface? Is the surface triangulated? Or are the points just 'floating in space' in a configuration that happens to approximate a sphere?

They're just a bunch of points. Triangulation should be fairly simple though, since I can determine neighboring points quite easily.

Quote:
 2. What do you mean exactly by 'unit vectors located across a plane'?This might be just me, but I usually have an easier time thinking about a problem if I know what the problem actually is, rather than having to put the pieces together from an abstract description. Would it be possible to describe the problem more specifically, or at least provide some more information about the context?

This should have been a little bit clearer: the unit vectors represent each pixel in an image. The application is a lens distortion model for optical systems, though the implementation and design is pretty complex and relies on a weighted rigorous non-linear least-squares adjustment.

I need to represent each pixel on the CCD chip as a point in 3D space, and then use this to project outwards to this curved surface. The intersection point between this vector and the surface is then used to compute additional images later.

Quote:

I'll have a read through this again today. But the Ray-Polygon testing looks pretty much what I was after.

Thanks

• 16
• 11
• 11
• 9
• 49
• ### Forum Statistics

• Total Topics
631394
• Total Posts
2999749
×