transform a unit cube to view frustum?

transform a unit cube to view frustum?

Post by hael » Fri, 06 Jun 2003 03:37:42



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?

Post by Peder Blekke » Sat, 07 Jun 2003 17:34:15



> 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?

Post by hael » Wed, 11 Jun 2003 01:54:02


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

 
 
 

1. Wanted: fast intersect code for xlated-rot'ed-scaled unit cubes

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

2. using Microsoft.DirectX ??

3. Transforming unit objects in a ray tracer

4. gimp plugins for download??

5. Frustum definition for realistic eye view

6. hardware question

7. View-Frustum-Culling

8. Fitting a viewing frustum to an AABB

9. view frustum culling algorithm?

10. How to calculate view frustum planes efficiently?

11. View frustum question

12. Question: computing corner pts of view frustum