10-04-2003, 12:54 PM

Ok, I think I've determined how to get the Xmin,Xmax,Ymin,Ymax of the world coordinate system for grid generation. There are three conditions.

1. The xy plane does not pass thru the viewing frustum.

2. The xy plane is co-planar with one of the clipping planes of the frustum

3. The xy plane passes thru the viewing frustum which means the xy plane intersects at least three of the intersections between two clipping planes. I hope that makes sense.

The method:

1. Construct 12 vectors representing the intersections of 2 clipping planes. For example one vector might represent the intersection of the far and top planes.

2. Determine which vectors are coplanar with the model coordinate system xy plane. If enough vectors are coplanar use those vectors to set up the grid XY values and go to step 4.

3. Determine if and where the 12 vectors intersect the model coordinate system xy plane. Use the intersection points to set up grid XY values.

4. draw grid.

Questions:

1. To get the normal of the model coordinate system I just need to multiply the vector (0,0,1) times the model transform matrix, right? Should I then normalize the result?

2. To determine if a vector is coplanar with the xy plane I need to check that the dot product of the xy plane normal and the vector in question is zero, right?

3. What calculation do I perform to determine if one of the 12 vectors intersects the model xy plane and where?

What do you think? Will this work?

1. The xy plane does not pass thru the viewing frustum.

2. The xy plane is co-planar with one of the clipping planes of the frustum

3. The xy plane passes thru the viewing frustum which means the xy plane intersects at least three of the intersections between two clipping planes. I hope that makes sense.

The method:

1. Construct 12 vectors representing the intersections of 2 clipping planes. For example one vector might represent the intersection of the far and top planes.

2. Determine which vectors are coplanar with the model coordinate system xy plane. If enough vectors are coplanar use those vectors to set up the grid XY values and go to step 4.

3. Determine if and where the 12 vectors intersect the model coordinate system xy plane. Use the intersection points to set up grid XY values.

4. draw grid.

Questions:

1. To get the normal of the model coordinate system I just need to multiply the vector (0,0,1) times the model transform matrix, right? Should I then normalize the result?

2. To determine if a vector is coplanar with the xy plane I need to check that the dot product of the xy plane normal and the vector in question is zero, right?

3. What calculation do I perform to determine if one of the 12 vectors intersects the model xy plane and where?

What do you think? Will this work?