# Direction Vector from Plane

I have a plane contrstucted by 3 points, so this gives me the plane normal’.

its direction in the x axis and the direction in the y axis’. I’m looking for some function that rotates a some degrees around the planes normal( so when looking straight at the plane this would look like a clock. And after that, i need to rotate around one of the other axis, so that the direction vector is going to ‘intersect the plane’

Any help on this one:)

Paul

The cross product gives the normal.

The rotate call is a standard glRotate matrix transformation in gl if you specify the normal as the axis of rotation.

Not sure what you mean by the last part, but I think a translation and rotation after the “clock” rotation is probably what you’re asking for.

Okay I can make a ‘clock’ in the plane now, but now i want to do something like this, make the line intersect with the plane at a 30 degrees angle( or any value).

Assume that you have 3 points p, q, r in the plane. One way to compute the plane normal is then e.g. n=cross(q-p,r-p).

You can use n as the rotation axis in glRotate, but also either of the difference vectors q-q, r-p, r-q or one of the vectors in the plane orthogonal to one of the differences, e.g.
cross(n,q-p)

These are the interesting possibilities I can imagine. Sorry, but your description was not too clear – perhaps you try out some of these.