|
Main /
Project3FAQFAQ for Graphics Town Example CodeSend your questions to the professor, and they'll get put here if others might be interested. Or if there's something you figured out and think others would like to know, send a note to the professor and he'll add it here. On this page... (hide) 1. How do you get transparent objects to work?Graphics town does not do full depth sorting. Instead, each object gets to draw itself twice. First the "draw" function is called for each object, then the "drawAfter" is called on each object. The idea is that any opaque parts go into draw, and the transparent parts go into drawAfter. This doesn't handle problems where multiple transparent objects get drawn in the wrong order, but it does make it so that opaque objects can be seen through transparent ones. Its an ugly hack, but it was much easier to do than depth sorting. If you want to do lots of transparency, you probably need to use depth sorting. |