During interactive editing, the system examines whether the parts protrude from
the card when closed or whether they collide with one another during closing
and opening. When the system detects such a protrusion or collision, it displays
a message on the lower right portion of the window and highlights the parts that
caused the error as shown in Figs. 7 (c) and (d). This occurs in real time. The
message and the highlights disappear immediately once the error is resolved.
&_'
&`' FTCI
&d' &f'
&e' &g' FTCI FTCI
&a'
&h'
&i'
UJKHVMG[
FTCI
FTCI
&c'
&b'
Fig. 6. User interface to edit shapes. The user can (a)-(e) change lengths; (f), (g)
change open angles; (h), (i) change gradient angles; and (j), (k) apply textures.
4 Implementation
We implemented our prototype system based on Glassner’s work [4] [5] [6] using
Microsoft Visual C++ with the MFC platform.
We also used OpenGL to render
the scene and OpenCV to read images. Fig. 3 shows the functions that were
implemented. Note that the Undo function has not yet been implemented. A
pop-up card is represented as a tree data structure. Each node of the tree corresponds
to a part and contains its relative position on the parent part and various
parameters. The system first computes the card position based on its open angle
and updates its center fold line information. It next updates the 3D coordinates
of the parts on the fold line. The system repeats this procedure recursively to
determine the 3D coordinates of all parts.
OQXG OQXG
ENQUG ENQUG
JKIJNKIJV
YCTPKPI YCTPKPI
JKIJNKIJV
C
D
E
F
G
H
Fig. 7. User interface when the system detects errors. (a), (b) The user moves a part.
(c), (d) The system displays a warning message and highlights the part if the system
detects an error. (e) The part protrudes from the card if the card is closed. (f) The
part collides with one another if the card is closed.
The system checks for protrusion and collision errors while dragging and
placing parts. The system checks for collisions at every 10◦
. This may miss a
minor collision, but this is not an issue due to the inherent flexibility of paper.
We initially tried checking every 1◦
, but this was too slow when the number of
parts increased.
Không có nhận xét nào:
Đăng nhận xét