skyofdwarf

03-07-2003, 08:45 AM

hello, wolrd.

I wonder, how get 8 points of frustum.

I see someone's message

'define a cube in clipping space that fills the space -1 < x < 1, -1 < y < 1, -1 < z < 1 and then transform the cube back to camera space by using the inverse projection matrix'

but,

v[0] = CVector(-1.0f, -1.0f, -1.0f); // xyz

v[1] = CVector( 1.0f, -1.0f, -1.0f); // Xyz

v[2] = CVector(-1.0f, 1.0f, -1.0f); // xYz

v[3] = CVector( 1.0f, 1.0f, -1.0f); // XYz

v[4] = CVector(-1.0f, -1.0f, 1.0f); // xyZ

v[5] = CVector( 1.0f, -1.0f, 1.0f); // XyZ

v[6] = CVector(-1.0f, 1.0f, 1.0f); // xYZ

v[7] = CVector( 1.0f, 1.0f, 1.0f); // XYZ

// inv = inverse(proj)

VtxMultiply(v[0]._v, inv);

VtxMultiply(v[1]._v, inv);

VtxMultiply(v[2]._v, inv);

VtxMultiply(v[3]._v, inv);

VtxMultiply(v[4]._v, inv);

VtxMultiply(v[5]._v, inv);

VtxMultiply(v[6]._v, inv);

VtxMultiply(v[7]._v, inv);

don't work.

and,

v[0~7] = v * inverse(proj*model);

don't work too.

please help me.

thanks any replies.

I wonder, how get 8 points of frustum.

I see someone's message

'define a cube in clipping space that fills the space -1 < x < 1, -1 < y < 1, -1 < z < 1 and then transform the cube back to camera space by using the inverse projection matrix'

but,

v[0] = CVector(-1.0f, -1.0f, -1.0f); // xyz

v[1] = CVector( 1.0f, -1.0f, -1.0f); // Xyz

v[2] = CVector(-1.0f, 1.0f, -1.0f); // xYz

v[3] = CVector( 1.0f, 1.0f, -1.0f); // XYz

v[4] = CVector(-1.0f, -1.0f, 1.0f); // xyZ

v[5] = CVector( 1.0f, -1.0f, 1.0f); // XyZ

v[6] = CVector(-1.0f, 1.0f, 1.0f); // xYZ

v[7] = CVector( 1.0f, 1.0f, 1.0f); // XYZ

// inv = inverse(proj)

VtxMultiply(v[0]._v, inv);

VtxMultiply(v[1]._v, inv);

VtxMultiply(v[2]._v, inv);

VtxMultiply(v[3]._v, inv);

VtxMultiply(v[4]._v, inv);

VtxMultiply(v[5]._v, inv);

VtxMultiply(v[6]._v, inv);

VtxMultiply(v[7]._v, inv);

don't work.

and,

v[0~7] = v * inverse(proj*model);

don't work too.

please help me.

thanks any replies.