In a graphics context, what does the term “rubberbanding” mean?

我与影子孤独终老i 提交于 2019-12-11 03:06:23

问题


In various locations, I've seen the term "rubberbanding" used when referring to graphics drawing. In such cases, people have seemed to recommending doing drawing using XOR, and I've gotten the impression that the term refers to a particular drawing technique used to avoid redrawing the entire frame.

However, I haven't been able to find anything that defines exactly what the term "rubberbanding" means. Just in a general sense, without discussing implementation details too heavily, what is the meaning of the term "rubberbanding" and what is its purpose?


回答1:


It's a very old technique for drawing a shape without clearing the screen. If you want to draw a moving rectangle, the idea is to draw only the difference between the previous frame and the new one (adding the new parts, erasing the old ones, leaving the common part untouched).

The XOR trick is that if you draw something with it, it sets your color to the framebuffer. If you draw with it a second time over the same area, it removes your color.

As far as I know this has not been used in interactive rendering since the 90s (at least on PC-like platforms).




回答2:


There's two meanings. Using XOR is how you implement rubber banding on a 1970s or 1980s era GUI, when the computers weren't fast enough to redraw the entire screen at interactive rates. (Except for a few heroic/insane assembly language efforts.)

As a user interaction technique, rubber banding was being able to draw a line by pressing the mouse button down at the start point and then dragging to the end point, with a continuously updating line as if there was a "rubber band" stretched between the two.

It became widespread after the first MacPaint and MacDraw came out in 1984. It seems obvious to us today, but at the time most CAD programs worked by 1. click on the start point, 2. move and click on the end point, 3. the computer draws a line between the two.



来源:https://stackoverflow.com/questions/28759432/in-a-graphics-context-what-does-the-term-rubberbanding-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!