12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Patch PropertiesPhong lighting generally produces better results than Gouraud lighting, buttakes longer to render.EraseMode{normal} | none | xor | backgroundErase mode. This property controls the technique <strong>MATLAB</strong> uses to draw anderase patch objects. Alternative erase modes are useful in creating animatedsequences, where control of the way individual objects redraw is necessary toimprove performance and obtain the desired effect.• normal – Redraw the affected region of the display, performing thethree-dimensional analysis necessary to ensure that all objects are renderedcorrectly. This mode produces the most accurate picture, but is the slowest.The other modes are faster, but do not perform a complete redraw and aretherefore less accurate.• none – Do not erase the patch when it is moved or destroyed. While the objectis still visible on the screen after erasing with EraseMode none, you cannotprint it because <strong>MATLAB</strong> stores no information about its former location.• xor– Draw and erase the patch by performing an exclusive OR (XOR) witheach pixel index of the screen behind it. Erasing the patch does not damagethe color of the objects behind it. However, patch color depends on the colorof the screen behind it and is correctly colored only when over the axesbackground Color, or the figure background Color if the axes Color is set tonone.• background – Erase the patch by drawing it in the axes’ background Color,or the figure background Color if the axes Color is set to none. This damagesobjects that are behind the erased patch, but the patch is always properlycolored.Printing with Non-normal Erase Modes. <strong>MATLAB</strong> always prints figures as if theEraseMode of all objects is normal. This means graphics objects created withEraseMode set to none, xor, or background can look different on screen than onpaper. On screen, <strong>MATLAB</strong> may mathematically combine layers of colors (e.g.,XORing a pixel color with that of the pixel behind it) and ignorethree-dimensional sorting to obtain greater rendering speed. However, thesetechniques are not applied to the printed output.You can use the <strong>MATLAB</strong> getframe command or other screen captureapplication to create an image of a figure containing non-normal mode objects.2-330

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!