Monica,
What you use for the scalefactor parameter in the arglCameraView call
depends on what units you want to do your OpenGL drawing in. If you
use a scalefactor of 1.0, then 1.0 OpenGL unit will equal 1.0
millimetre (ARToolKit's default units).
In the example, a scalefactor of 0.025 makes 1.0 OpenGL unit equal to
(1.0 / 0.025) ARToolKit units, i.e. 40 mm. Then, when the cube is
drawn with sides = 1.0 OpenGL units, it fills the white portion of
the ARToolKit marker (the white portion of the marker being 40 mm per
side.)
If your CAD model of your lab was scaled in metres, then you'd want
to use a scalefactor of 0.001.
Don't forget that the near and far clipping planes of your OpenGL
projection are set in a different place.. the arglCameraFrustum call.
To use your CAD model example again, you would probably want to set
the near clipping plane to something like 0.2 metres, and the far
plane to something like 40 metres. Making the "near" value bigger and
the "far" value smaller will increase the resolution of your z buffer.
I should point out that these scalefactors are only available with
libARgsub_lite.. not with libARgsub. Having control of these factors
at run-time was one of the motivating reasons for the creation of
libARgsub_lite.
Hope that helps,
Phil.
On 04/10/2005, at 6:55 AM, Monica Rubio Rojas wrote:
> Hi there.
>
> I'm trying to use the "twoView" sample released in ARToolkit 2.70,
> and I'm
> experiencing some problems. At a first glance, I can't work with
> real units for
> the environment (I have a CAD model of my lab), and I've noticed an
> strange
> value "VIEW_SCALEFACTOR" fixed to 0.025. When I try to make the
> system work in
> real units (fixing the parameter to 0.0, or 1.0), I loose the
> sample cube from
> the view. Curiously, when I increase the parameter, the cube goes
> smaller, and
> when I decrease it, goes bigger.
>
> Anyone can tell me where is the problem? How can I work with real
> units for the
> markers and the object in the CAD model?
>
> Best regards,
|