Determining whether anti-aliasing is supported
Not all 3D renderers can perform the additional calculations that anti-aliasing requires. If
you have a 3D sprite that you want to anti-alias, check first that the 3D renderer supports
anti-aliasing. The renderers that currently support anti-aliasing include the Director software
renderer, and DirectX 5.2 and DirectX 7.0.
If the 3D sprite is in channel 1 of the Score, you would test the
property of sprite 1, as shown in the following example:
if sprite(1).antiAliasingSupported = TRUE then
Turning on anti-aliasing
If the
antiAliasingSupported
by setting the sprite's
sprite(1).antiAliasingEnabled = TRUE
For example, if you have a 3D sprite in channel 5 and you want to turn on anti-aliasing for the
sprite when it first appears on the Stage, you would write a
the sprite. Your script should contain code as shown in the following example:
-- Lingo syntax
on beginSprite
-- check whether anti-aliasing is supported by the current 3D renderer
if sprite(5).antiAliasingSupported = TRUE then
-- if it is, turn on anti-aliasing for the sprite
sprite(5).antiAliasingEnabled = TRUE
end if
end beginSprite
// JavaScript syntax
function beginSprite() {
// check whether anti-aliasing is supported by the current 3D renderer
if (sprite(5).antiAliasingSupported) {
// if it is, turn on anti-aliasing for the sprite
sprite(5).antiAliasingEnabled = true;
}
}
Turning off anti-aliasing
If you plan to animate any part of a 3D sprite, you might want to turn anti-aliasing off
temporarily to improve the animation performance. To do this, set the
property for the sprite to
complete.
It is a good idea to turn anti-aliasing on and off on separate handlers. For example, you might
want to animate a model, camera, or light while the mouse button is held down and stop the
animation when the mouse button is released. In that case you would turn off anti-aliasing in a
handler and turn it back on in a
mouseDown
-- Lingo syntax
on mouseDown
-- user interaction/animation is about to start so turn
-- anti-aliasing OFF
sprite(1).antiAliasingEnabled = FALSE
-- start animation
property is
antiAliasingEnabled
. You can then set it back to
FALSE
antiAliasingSupported
, you can turn on anti-aliasing for the 3D sprite
TRUE
property to
.
TRUE
beginSprite
when the animation is
TRUE
handler, as shown in the following example:
mouseUp
script and attach it to
antiAliasingEnabled
Using 3D Anti-aliasing
311
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?
Questions and answers