Jump to content
  • Advertisement
Sign in to follow this  
osso

Working with ellipsoids and plane projection..

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just a quick question could someone confirm that if you calculate the normal of an ellipsoid from a point on the surface. can I safely assume that the following assumption should be correct? p.n = 1 // let p = point on surface, n = ellipsoid normal vector I have a small area of points definied on the surface of an ellipsoid, which I would like to project to the plane of calculated normal. I initially thought I was having issues with floating point precission but I am not so sure now. When I compute the dot product of the projected vectors on the plane, with the ellipsoid normal vector, they dont seem to equal 1 I can post code if required. Regards

Share this post


Link to post
Share on other sites
Advertisement
I don't know what you mean by "p.n". You can't compute a dot product between a point and a vector (well, you can but the result doesn't mean anything).

Yes, a bit of code might help.

Share this post


Link to post
Share on other sites
I meant the Dot Product of the following

1) the surface vector which is the point on the ellipsoid surface
2) the normal vector which is tangent to the point on the ellipsoid surface

I think should be equal to 1.




Share this post


Link to post
Share on other sites
I have tried earlier today testing points on the poles, and I have noticed p.n do equal exactly 1.

one example away from the poles i get p.n = 1.0000000000188922

I initially thought this was a precision issue, turns out that it might not be after all. however this still leaves me with an issue projecting points to the ellipsoid normal tangent plane.

lets say I take the ellipsoid normal of the first point on the surface as a reference. to project a point on the surface to the plane, the equation is

projected_point = point - [point.normal]*normal

in code form..

// the following takes the point on the surface, and its calculated normal vector
double d1 = DotProduct(ref, normal);

// d1 = 1.0000000000188922

double d2 = DotProduct(point, normal); // point = another point on the surface

// d2 = 8.9100786519611319e-008

proj[0] = point[0] - d2*normal[0];
proj[1] = point[1] - d2*normal[1];
proj[2] = point[2] - d2*normal[2];

double d3 = DotProduct(proj, normal);

// d3 = 0.99999991091810569





I am trying to work out why d3 != d1 when in theory ref and proj should be on the same plane.

Share this post


Link to post
Share on other sites
Quote:
Original post by osso
I meant the Dot Product of the following

1) the surface vector which is the point on the ellipsoid surface

That still didn't make sense. I'm going to guess you mean the vector from the center of the ellipsoid to a point on the surface.

Quote:
2) the normal vector which is tangent to the point on the ellipsoid surface

"Tangent to the point"? That doesn't make sense either. You probably mean the unit normal vector to the ellipsoid at that point on the surface.

Quote:
I think should be equal to 1.

I don't. It only works in case your ellipsoid is a sphere of radius 1.

Share this post


Link to post
Share on other sites
Firstly, you can't take a dot product of a point and a direction. What you're actually taking the dot product of is the normal and the direction from the centre of the ellipsoid to the point on the surface.

Second, as has been stated already, p.n won't have a constant value on an ellipse (other than a sphere). Even for a sphere, it is only 1 if the radius is 1.

I am not sure what you are trying to do, but your projection will project onto a plane through the origin, which I don't think is what you want.

Share this post


Link to post
Share on other sites
I have just realised the stupidity, you're right it is not what I want at all!!

I think I know where i've gone wrong now!

Share this post


Link to post
Share on other sites
The standard plane equation
ax + by + cz + d = 0
n.p = -d

So from your code d1 gives you the constant in the standard plane equation...
d = -d1

p' the projected point = p - d'n
where d' is the perpendicular distance from p to the plane

d' = p.n - d (d from the plane equation)
In your case
d' (d2) should be = point.normal + d1

Then the projection should work fine

[Edited by - daftasbrush on April 1, 2008 3:28:13 PM]

Share this post


Link to post
Share on other sites
I made an error in calculating my ellipsoid normal by assuming the following will give me the normal..

normal[0] = ((point[0])/pow((double)radius[0],2));
normal[1] = ((point[1])/pow((double)radius[1],2));
normal[2] = ((point[2])/pow((double)radius[2],2));

It looks like it is giving me the normal's direction from the point on the ellipsoid surface. I need to give it a constant velocity and add it to the original point to compute the real xyz coordinates of the normal vector.

then I can begin to understand why my projection got messed up.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!