Journal of Microcomputer Applications (1992) 15, 187-193
Fast display
of solid
objects
M. Nassar School of Computer Science, Carleton University, Ottawa, Ontario, Canada With the advance of hypermedia systems there is a need for high performance workstations to allow the engineer to manipulate and display solid models at interactive speeds. This paper deals with the development of the model structure and describes an algorithm which projects solid geometry onto the monitor. This algorithm will display both a boundary representation and a constructive solid geometry representation of the solid on the screen. Image display will be fast, since the subimages are calculated simultaneously.
1.
Introduction
The technical aspect of a hypermedia system can be characterized by its underlying data structure, its tools, its user interface, and the degree of its integration with the underlying environment and the other applications running on the computer [l]. Some hypermedia systems are engines that can display many different kinds of hypermedia document. Other systems are built specifically to display a single kind of document and therefore provide a much richer interaction with respect to the content of the particular kind of document; a detailed discussion can be found in [2]. Although hypermedia technology is widely accepted and its principles appear in more and more software products, it is difficult to forecast the future of large application areas of hypermedia, because we do not have enough experience of real time use of hypermedia. Also, one potential objection for the use of, for example, a hypermedia cataloging system is the fact that it would require large amounts of storage for digital pictures and sound [3,4]. Our solution to the storage problem is a multiprocessor machine. With the realization of very large-scale integration, it is becoming more and more viable to build multiprocessor machines. Therefore, it is important to design algorithms which take advantage of their capabilities. The area of hypermedia is one field which can reap the advantages of parallelism. This paper presents part of a hypermedia system to display a 3-dimensional solid on the screen. In Section 2 we will describe our model of computation, and how the parallel algorithm is executed. In Section 3 we will briefly introduce a parallel algorithm to show a solid by displaying both its boundary representation and its constructive solid geometry (CSG) representation on the monitor. In other applications, a parallel CSG technique is used to construct octree representation of a solid object by taking crosssectional images of the solid and merge them in sequence. This technique is used in medical applications in which the cross-sections are obtained by computed tomography methods [S]. The final section is our conclusion.
2.
Model of computation
There is a need for a high performance
workstation
to allow an engineer
to manipulate
187 0745-7138/92/030187 + 07 $03.00/O
0 1992 Academic Press Limited
188
M. Nassar
and display a solid model at an interactive speed. The basic strategy for fast image generation is to decompose the whole solid which is represented by a CSG tree into a large number of regular smaller ‘subtrees’ that can be executed in parallel. The proposed architecture has a useful property in that it consists of a large number of similar processors with a bounded amount of memory in each processor. The model of computation does not require much local communication or a large amount of local storage. This makes it ideal for very large-scale data with fast implementation. 2.1
System hardware configuration
Mass storage has engendered a whole new way of thinking about data and its manipulation. It is feasible to have multiple representations of information at different points in the network at the same time. These multiple representations of information can be linked to each other. The enhancement of hardware compatibility enables information to be distributed and transmitted across networks [6]. The multiprocessor model of computation consists of the following main components: Input host computer. For visualization of solid models, workstations (for input) are the
most important component of the input host. Other components include the controller that passes the data around and receives requests. Host Interface. The host interface is responsible for reading requests from the input host and putting them into the system through the command bus, where they continuously circulate until a Master Processing Element (MPE) is free to classify them. The free processor then becomes busy and will pass a request unchanged until it has finished processing. Master Processing Element (MPE) . A set of MPEs is connected to the command bus. Each master processor has a controller and controls a sequential set of slave processing elements (SPEs), in addition to ordinary microcomputer components such as MPU and RAM. An SPE has a number of registers and can send output to and receive input from each of its neighbours or from its master processor. Video Interface. After each MPE finishes processing, its controller inserts the result (subimage) into the system through the video bus, where it is read by the video interface and passed to the output monitor. Output Monitor. The output monitor receives its input image from the video interface. The model has a big enough screen to show at the same time the boundary representation and the CSG representation as a user clicks the mouse. Image display will be fast, since the subimages are calculated simultaneously. Figure 1 shows the model hardware configuration. Although object-parallel systems typically require specialized processors, which limit the types of primitives that can be displayed; a number of experimental object-parallel systems have been proposed, but few have led to commercial products. The system that we proposed is a very practical model of computation; a Cellular Array Processor is a version of the system that we developed [7]. However, there are still some problems remaining for further research.
3.
Hidden
surface
removal
algorithm
The basic idea is to partition a solid model into submodels, and generate subimages in
Fast display of solid objects
189
Host interface Command
I Video
Video
bus
bus
interface
I
Figure 1. Multiprocessor machine as a model of computation.
parallel using the multiprocessor machine that we described in Section 2. By implementing the following algorithm on the system, one can display both a boundary representation and a CSG representation of the solid. The success of this approach relies on the fact that there is a special coherence in the object: that cells near each other in space are likely to contain a similar set of primitives. One can construct a solid’s CSG tree, based on the interior, from volume post-order pixel numbering, but is not storage efficient. So during numbering the solid parts we stop dividing a block which has the same ‘colour’. Thus the cells especially close (in the same block) can also proceed together. 3.1
Data representation
Definition: The application of the volumetric boolean set of operations to solid objects in order to represent more complex solid objects is commonly referred to as constructive solid geometry (CSG). The main data representation scheme in CSG are solid models as a combination of primitive solids. Two primitives A and B can be combined to form a new solid object by applying one of the volumetric boolean operations. The CSG binary tree is a representation whose leaf nodes represent instances such as cubes, cones, and spheres, which are the primitives of the tree. The inner nodes represent set theoretic combinations of two subsolids. The set operations [U, n, -1 are union (U) (A U B is that volume of space found in either A or B), intersection (n), and difference (-). A 2-dimensional illustration is given in Figure 2(a), a 3-dimensional illustration in Figure 2(b).
190
M. Nassar n
AnB-C
Figure 2(a).
Figure 2(b).
A 2-dimensional
A 3-dimensional
CSG.
CSG.
The solid is defined by a large CSG tree, which is split into a set of subtrees as in Figure 3. Each subtree is handled independently by a master processor and its slave processor elements. The objective is to produce a shaded image of a large CSG object at real time speed. For example, the tree in Figure 3(a) can be split into the two subtrees in Figure 3(b). 3.2
Hidden surface removal (HSR)
We chose a general CSG hidden surface removal algorithm [7] that can generate images in such a way that surface removal between submodels is done by comparing the Z-value for each pixel (which are saved in a Z-buffer). In generating images in 3-dimensional environments, two kinds of processing must be executed: (i) Calculations executed prior to hidden surface removal include the volume decomposition of the solid, coordinate evaluation, and finding the position of the vertices and all the data for the boundary. This process is done by the multiprocessor machine and takes a substantial amount of computing time, but most of the operations are simply arithmetic loops. (ii) Hidden surface removal using a scan-line algorithm. This involves complex operations. After geometrical computation is done, the host computer transmits a list, volume of data, to each master processor to perform hidden surface elimination in parallels (Figure 4). Volume decomposition was performed by Kedem and Ellis’s Raycasting Machine [8]. The Raycasting Machine is a hardware implementation that creates small CSG objects at interactive rates. The Raycasting Machine maps a CSG tree to hardware by assigning
Fast display of solid objects
Figure 3(a).
A whole CSG binary
Figure 3(b).
tree.
A decomposition
Status
1
Three primitives
tree.
tree
-
Figure 4.
J
being processed
each CSG primitive to a processor called a primitive processor called a classification combiner. 3.3
of a CSG binary
191
by a ray tracing.
classifier
and each operator
to a
Scan-line hidden surface removal algorithm
The algorithm we took is a scan-line hidden surface algorithm, which is one of the standard algorithms in computer graphics for this purpose, with an extension to make it suitable for the class of CSG models. Although the 3D union, difference, or intersection of two solids is difficult when it must be done by direct comparison of one primitive with another, a ray tracing allows the 3D problem to be reduced to a set of ID calculations. The functional steps for the algorithm are as follows: The host computer divides the database among the MPEs. Each MPE initially assigned to small CSG tree of a region. Each MPE has direct access to the tree reached by any ray that passes through its region. Each MPE partition the voxels, by the help of the Raycasting Machine, into 3D primitives and assign each to a separate SPE. For each MPE, in parallel,
the following
is executed:
Each SPE computes the intersection of a ray and primitive object, as in Figure 4, to get a set of k-values, each value specifies a point at which the ray enters or exits the primitive. Boolean operations are calculated one ray at a time by determining the 1D union, difference, or intersection of spans from the two primitives along the same ray. This segment is passed upward.
192
M. Nassar
For each ray the CSG hierarchy is traversed by evaluating the operation at each node of the CSG tree. The updated segments are passed upward in the tree until they reach the root. Apply the CSG-combine function that takes two lists of intersection records, each order by increasing k, and combine them according to the operation being performed. The lists are merged by removing the intersection record. Pass your voxel’s contributions to MPE. Each MPE gets the contributions from its SPEs and composite them and determine the depth of each surface point. If a point is at a greater depth than a previously recorded object point, it is hidden and therefore disregarded. The depth value is updated in preparation for the next depth test. If an MPE processed all the primitives in its region, it is assigned the next region needing processing. The controller builds a subimage of pixel computations and passes it to the video interface. End. For a more detailed implementation of such an algorithm see [7]. Our system uses CSG representation for compactness and a boundary representation for quick retrieval of useful data not explicitly specified in CSG representation, such as connectivity. Since the nearest primitives are scan-converted last, they obscure primitives which are further away by writing over them. This hides distant surfaces and make the nearest surface visible. 3.4
Overview
The system operates with any set of 3-dimensional data by partitioning the solid model into submodels. The host computer passes all the geometric computation to the master processors. Using this information all master processors and their slave processors will implement the hidden surface algorithm. When one group of SPE reports having finished to their master, the controller for the master processor maps its subimage through the video interface to a certain area on the screen.
4.
Conclusions After all is said and done, uslially more is said than done.
The technique we describe, including the system hardware and the algorithm, is a fast technique as the number of processor elements increased. The technique enables us to present a solid body by displaying both boundary and CSG representations on the screen. This technique is used in medical applications in which the cross-sections are obtained by computed tomography methods. By our new model, image display will be fast, since the subimages are calculated simultaneously.
Acknowledgement The author gratefully acknowledges the many useful comments from the anonymous referee.
Fast display of solid objects
193
References 1. 1. Tomek, S. Khan, T. Muldner, M. Nassar, G. Novak & P. Prozknski 1991. Hypermedia-introduction and survey. Journal of Microcomputer Applications, 14, 63-103. 2. J. Neilsen 1990. Hypertext and Hypermedia. Academic Press, Inc. 3. H. Maurer & M. R. Williams 1991. Hypermedia Systems and other computer support as infrastructure for museums. Journal of Microcomputer Applications, 14, 177-l 87. 4. I. Tomek & H. Maurer 1991. The Analyst as a starting point for a hypermedia system. Journal of Microcomputer Applications, 14, 139-l 60. 5. J. K. Udupa, S. N. Srihari & G. T. Herman 1982. Boundary detection in multidimensions. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-4, 41-50. 6. K. Parsaye, M. Chignell, S. Khoshofian & H. Wong 1989. Intelligent database, Object-oriented, Deductive Hypermedia Technologies. New York: John Wiley & Sons, Inc. 7. H. Sato, M. Ishii, K. Sato, M. Ikesaka, H. Ishihata, M. Kakimoto, K. Hirota and K. Inoue 1985. Fast Image Generation of Constructive Solid Geometry using Cellular Array Processors. Journal of ACM, 19, 9S102. 8. G. Kedem and J. L. Ellis 1984. The Raycasting Machine. Proceedings of the 1984 International Conference on Computer Design, pp. 533-538.
Mostafa Nassar received a BSc degree from the Faculty of Science, AinShams University, Cairo, Egypt, in 1970 and MSc and PhD degrees in Mathematics from the State University of New York at Buffalo, USA, in 1981 and 1984, respectively. He received a Diploma in Computer Science in 1987 from Clarkson University, Potsdam, New York, USA. Dr Nassar is currently on leave, at Carleton University, from Acadia University, Wolfville, Nova Scotia, Canada. His research interests are in the area of algorithm design, parallel computation, and hypermedia systems.