## transform a unit cube to view frustum?

### transform a unit cube to view frustum?

hi,

i want to create a shape, that shows the camera view frustum of a
specific camera. my*question:
is there a simplier way, than create a shape (SoTriangleStripSet) to
see the viewfrustum?
so i didn't no that way, i created a unit cube (sidelength 2 ;
center=(0,0,0) ) with a triangle strip set and want to transform it to
a view frustum.

SbViewVolume myVol = myCamera->getViewVolume();
SbMatrix mat = myVol.getCameraSpaceMatrix();

the matrix mat i wnated to use inverse, to get the inverse camera
space transformation, so

mat.inverse();
myTransform->setMatrix(mat);

the transform node is used to transform the shape. but it didn't work.
i don't know, if i use the correct matrix from camera (the
transformation from specific view frustum to a unit cube)???

can anyone help me??

thanks
haelje

### transform a unit cube to view frustum?

> i want to create a shape, that shows the camera view frustum of a
> specific camera. [...]
> the matrix mat i wnated to use inverse, to get the inverse camera
> space transformation, so

> mat.inverse();
> myTransform->setMatrix(mat);

This should be:

mat = mat.inverse();
myTransform->setMatrix(mat);

Since SbMatrix::inverse() _returns_ the inverse matrix.

Peder

### transform a unit cube to view frustum?

Quote:>   mat = mat.inverse();
>   myTransform->setMatrix(mat);

hi,

i tried it, but it doesn't solve the problem. i always have a
transformed cube, but no view frustum object ....

but thanks
haelje

Working on a robot simulator and need a fast way to determine whether
two unit cubes, that have been arbitrarily rotated, scaled and
translated but not twisted or sheared, intersect.  Do not need to kn?ow
anything about the shape of the intersection just whether it occurs.

Code would be great and references appreciated.

Regards,  -John

Computer Science Dept
Brown Station, 02912