perspective
Principe
Default databases (supposedly set in 3D in the absolute coordinate system) are put into perspective by the classical method
of linear perspective
by conical projection of 3D points on the table, the top of the cone is the eye looking to the
aim point , with some focal and some roll.
Cylindrical perspective, curve perspectives,
procutedural perspective and adaptive adaptative perspective
are available in real time.
pers
pers
Returns the perspective type.
pers(p)
Activates perspective of type p:
p=0: cylindrical (isometric).
p=1: conic (default).
p=2: curved.
p<0: procedural.
pers(x1,y1,z1,x2,y2,z2,...)
Returns the perspective projection of the 3D polygonal line
(x1,y1,z1), (x2,y2,z2), ...
Examples:
1) pers 100,200,300;
returns the perspective projection of the 3D point of absolue coordinates
100,200,300
2) pers(CG vol(1));
returns the perspective projection of center of gravity of volume 1.
3) pers(CG(poi[1,4] vol 1));
returns the perspective projection of center of gravity of points (1,2,3,4) of volume 1.
pers abs
pers abs view(id)
Returns the matrix from perspective system to absloute system of view(id).
Cylindrical perspective
pers(0)
or no pers
Activates the cylindrical perspective (isometric).
pers normal
pers normal
With no pers, retutns the 9 parameters (xo,yo,zo, xc,yc,zc, xup,yup,zup)
defining the OpenGL gluLookAt transformation.
xo,yo,zo = eye position.
xc,yc,zc = position of thne referenced point.
xup,yup,zup = aim direction.
pers normal(xo,yo,zo, xc,yc,zc, xup,yup,zup)
Changes these parameters.
Conic perspective
pers(0)
or no pers
Activates the conic perspective (default).
Curved perspective
pers(2)
Activates the curve perspective: light rays are no longer straight lines but arcs through the eye, the aim point and the point to put into perspective.
Note: this perspective is computed in the block poi from the block poi validate,
this is why it is necessary to validate(1)poi vol(id)
whenever the geometry of the volume id is changed, and validate(-1)poi vol(id) to exit this perspective mode.
Procedural perspective
pers(p<0)
Activates the procedural perspective executed by function pers_utilisateur() of file
utilb.c
pers screen
pers screen view(id)
Returns the matrix from perspective system to screen system of view(id).
Adaptative perspective
Defining local functions on a view, if yes local and if yes view are ative, these functions are an encapsulated program in the view,
and it will be executed for each invocation of this view. . See an example in the VIEW function () of file
demo1_local.func.
See also: