## Recent topics-
*26 weeks 2 days*ago -
*45 weeks 3 days*ago -
*1 year 18 weeks*ago -
*1 year 26 weeks*ago -
*1 year 36 weeks*ago
## Recent Comments |
## calculation of a shear transform according to off-axis point of viewHello, I experiment some openGL fundamentals operations like transformation matrices, frustum, off-axis rendering, head-tracking, etc... not for a specific project, just working around. My goal is to find correct 2D points of 1024 Perspective patch (4 corners) to make the appropriate shear according to the position of a camera (or eye) in real space, in relation to screen size / position / rotation. My target object is a square, I want to see a regular square from "any" point of view, at constant apparent size. I would like to know if the following reasoning is correct : - default horizontal viewing angle in QC is 60°
- a sprite is positioned at (x,y,z) = 0 and width = 2, it fits the screen (horizontally)
- so the point of view in QC coordinates is at Z = 1/ tan (30°) = 1.73205
- real world Z from screen = 1.73205 x half-width of screen
and - i've read somewhere that default frustum's Znear is 0.1 (no idea if QC does the same)
- Is it why a sprite or GL point can't be seen on the screen (it vanishes) for Z > 1.63205 ( uh? equal to 1.73205 - 0.1)
As a first exercise, I've made the attached composition (with comments) + a top view of the same world. It gives some results, seems to work, but it may be not accurate. I really would like your opinion. Any advice to achieve this properly ? Something with matrices only, I suppose 1024 perspective (thanks frz!) can be replaced by a appropriate transform matrix ? Thanks by advance ! - By zanroversi (82) at 2012-08-17 15:06
- Developing Compositions
- Login or register to post comments
## More like this |

I thought the default horizontal fov was 90° - you can use the "NI OpenGL Create Matrix" and "NI OpenGL Set Matrix" patches to view and and set the projection and modelview matrix's

Thanks jrs, i'll try this asap. ++