Sign in to follow this  
salmonsolid

Intersection of vector and surface

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 this post


Link to post
Share on other sites
Quote:
Original post by salmonsolid
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.
I'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?

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 this post


Link to post
Share on other sites
Quote:
Original post by jyk
I'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:
this might help you.

Ray Object Intersections

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

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this