CA2241854C - Computer-assisted animation construction system and method and user interface - Google Patents

Computer-assisted animation construction system and method and user interface Download PDF

Info

Publication number
CA2241854C
CA2241854C CA002241854A CA2241854A CA2241854C CA 2241854 C CA2241854 C CA 2241854C CA 002241854 A CA002241854 A CA 002241854A CA 2241854 A CA2241854 A CA 2241854A CA 2241854 C CA2241854 C CA 2241854C
Authority
CA
Canada
Prior art keywords
pose
getareal
false
sub
true
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CA002241854A
Other languages
French (fr)
Other versions
CA2241854A1 (en
Inventor
Roman B. Kroitor
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Imax Corp
Original Assignee
Imax Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US08/578,293 external-priority patent/US5854634A/en
Application filed by Imax Corp filed Critical Imax Corp
Priority to CA002483943A priority Critical patent/CA2483943C/en
Publication of CA2241854A1 publication Critical patent/CA2241854A1/en
Application granted granted Critical
Publication of CA2241854C publication Critical patent/CA2241854C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

A system and method for intuitively generating computer assisted animation utilizes a transformation space in which a computer input device such as a three-dimensional drawing wand is moved to generated constructed poses from a plurality of source poses. The transformation space may be in the form of a tetrahedron with each of the four vertices representative of a source pose. At any point within the three-dimensional volume of the tetrahedron, a constructed pose may be defined based on weighted averages of the four source poses. The animator may create a sequence of animation simply by moving the drawing wand within the tetrahedron. The rate of change of the transformations of the constructed poses is controlled by the rate of movement of the drawing wand but may be altered after the sequence of constructed poses is defined. An additional aspect of the invention relates to the modification of portions of drawings by drawing a "warp" path in space to specify relative displacement from a reference point. The segment or segments affected, and the extent to which the points that comprise the segments are affected, is then specified. This technique may be adapted to create complex motions and wind, inertia, and wave effects in animated objects.

Description

T' e: Computer-Assisted Animation Construction System and Method and User Interface F; Pl d of the Invention This invention relates to a system and method for creating two and three-dimensional computer-assisted animation, and a simple and intuitive user interface far generating a series of animation images from a relatively few source drawings.
Background of the Invention The field of animation concerns the creation of the illusion of motion by rapidly displaying a sequence of still images, with each image slightly changed from the previous image. In the early years of animation, the drawings were strictly made by hand, which is a tedious and time-consuming process given the Iarge number of drawings required for even a short animation segment. More recently, with the advent of computer graphics technology, computers have been used in the animation process.
Animators are often reluctant, however, to depend too heavily on computers for generating drawings because of the noticeable difference between hand drawn figures and objects and computer-generated figures and objects, which appear robotic rather than life-like.
More accepted in the animation field are computer systems permitting animators to create drawings on computer display devices using a mouse, drawing tablet or other input device rather than pen and paper. In these systems, computers are often used to assist an animator in creating an animation sequence by generating intermediate animation frames which are placed in between frames drawn by the animator. The frames drawn by the animator are referred to as key frames or poses. The computer generated intermediate frames are referred to as "in-between"
frames and are used to transform an image from one key pose to another.
The process of generating these in-between poses is often referred to as "tweening" or "in-betweening." Generation of the in-between poses is based on computer interpolation between the animator's key frames. The SUBSTITUTE SHEET (RULE 26) WO 97/24696 PCT/CA96/Om881 _2_ animator specifies the number of in-between frames based on the complexity of the motion, and the computer generates the in-between frames to create a smooth transformation in the resulting animation sequence. The advantage of this technique is that it eliminates the laborious task of manually generating the individual in-between frames.
Computer in-betweening for three-dimensional animation is discussed in U.S. Patent No. 4,600,919 to Stern.
Prior art computer tweening methods are lacking in several respects. First, some prior art tweening systems use simple linear interpolation to generate intermediate poses between key frames. One problem with this approach is that it results in actions in objects that appear "robotic." The problem can be minimized by increasing the number of key poses, but this requires more manually generated drawings and defeats the purpose of computer-assisted tweening. Another problem is that linear interpolation can cause distortion of objects experiencing rotational motion by shortening segments of the objects at certain angles of rotation. A third problem is that discontinuities in the speed of motion often result if i) the number of in-betweens in adjacent intervals is constant, but the distance between key poses is not, or ii) the distance between adjacent key positions is equal but the number of in-between poses in the interval are not. These problems are discussed more fully in D.H.U. Kochanek, R. Bartels, .and K.S. Booth, "A Computer System for Smooth Keyframe Animation," Rep. No. CS-82-42, University of Waterloo Computer Science Dept., 1982.
Several researchers have developed improvements to the simple linear interpolation technique as discussed in Kochanek et al. One such technique is referred to as the "P-curve." In this process, the animator traces out a motion path along which an object is to move. In addition, to account fox transformations in the object as it moves, the animator can specify a selection function to designate which picture of an object is used for any given frame along the P-curve. For example, the object can be a bouncing ball and the animator can specify that as the ball SUBSTITUTE SHEET (RULE 26) bounces, a drawing showing a compressed ball can be used.
These prior art techniques are cumbersome for animators to use, however, because they are complicated and do not provide a simple, easy-to use user interface. There is thus a need for a computer-assisted animation construction system and method that permits an animator to create high quality animation simply and intuitively.
Summar~of the Invention It is an object of the present invention to provide an improved system and method for computer-assisted generation of animation.
In one aspect of the invention there is provided, in a computer animation system, a process for creating animation drawings for use in an animation sequence depicting a transformation of an object, the process comprising:
selecting a plurality of source poses for said object, each said source pose comprising a predetermined form of said object, defining a pose transformation space dependent upon the number of said selected source poses, assigning each said source pose to a point within said pose transformation space, traversing a path within said pose transformation space using a computer input device, said computer selecting a plurality of points along said path, calculating, for each said selected point, the distance to each of said source pose points, generating, for each said selected point, a corresponding constructed pose, said constructed pose comprised of a composite of said source poses, wherein the contribution of each said source pose is determined by its distance to said selected point, and storing said constructed pose for use in an animation drawing.

-3a-The invention also provides a computer animation system for creating animation drawings for use in an animation sequence depicting a transformation of an object comprising:
means for storing a plurality of source poses for an object for use in an animation sequence for said object, each said source pose comprising a predetermined form of said object, means for defining a pose transformation space dependent upon the number of said stored source poses, means for assigning each said source pose to a point within said pose transformation space, means for traversing a path within said pose transformation space using a computer input device, said computer selecting a plurality of points along said path, means for calculating, for each said selected point, the distance to each of said source pose points, means for generating, for each said selected point, a corresponding constructed pose, said constructed pose comprised of a composite of said source poses, wherein the contribution of each said source pose is determined by its distance to said selected point, and means for storing said constructed pose for use in an animation drawing.
The system and method of the present invention improves on the known concept of using a computer to interpolate between sequential key poses of an animation sequence through the use of what are referred to herein as "source poses." A source pose is an animator-created drawing of an object used in the present invention to create computer-generated poses of the object for animation. Unlike the prior art concept of key poses, a source pose may, but is not required to be, part of the animation.
The invention has application to both two and three-dimensional computer animation. In the system and method of the present invention, any number of source poses can in theory be specified by the animator, but practically 1-7 source poses would be used. These source poses do not necessarily correspond identically to the appearance of ,, the animated object in any of the resulting animated poses. The source poses are used to construct composite poses used in animation sequences, , referred to herein as "constructed poses." In each constructed pose, the object's appearance is constructed from a weighted average of the source poses. A three-dimensional drawing space is provided using a computer-driven stereoscopic viewing system incorporating a computer input device such as a three-axis (6 degree of freedom) position sensor or drawing "wand" which utilizes sensors to track the movement .and orientation of the wand in three-dimensional space. The position of the wand is represented by a cursor which is displayed within the three-dimensional drawing space.
A predetermined portion of the three-dimensional drawing space, referred to herein as the "pose transformation space," is displayed in the viewing system. In one embodiment, the pose transformation space is a tetrahedron. In this case, four source poses are represented by the tetrahedron, one at each vertex. Each point within the tetrahedron represents a constructed pose defined by a unique combination of the four source poses. The drawing wand is moved to control the movement of . the wand cursor within the tetrahedron in order to define the transformation of the animated object. The position of the wand cursor relative to each vertex of the tetrahedron controls the constructed pose at that point in time. The constructed poses are composed of weighted averages of the source poses. The constructed poses are viewed in real-time as the wand cursor moves within the pose transformation space '' enclosed by the tetrahedron, thus providing instantaneous feedback to the animator of the action being created or "scripted."
in this manner, an animated object can be made to perform any action which, given the nature of the four source poses, can be specified by a progression of three-dimensional graph points determined SUBSTITUTE SHEET (RULE 26) WO 97/24696 PC'T/CA96/00881 by the path of the wand in the pose transformation space, referred to herein as a "transformation graph." In addition, the velocity of the pose transformation may be controlled by the rate of motion of the wand cursor in the pose transformation space. Alternatively, the velocity may be r 5 independently controlled by displaying a graphical representation of the relative rate of transformation as a function of position along the transformation graph -- referred to herein as a "velocity profile graph" or velocity profile for the transformation -- to specify the instantaneous rate of transformation. This velocity profile permits an animator to modify the rate of transformation along the transformation graph using the input device.
The actions of different characters and objects and parts thereof may be defined using different transformation graphs, thus providing independent control over the action of the characters in a I5 resulting animation sequence. If less than four source poses are to be used by the animator, a two-dimensional transformation space may be used (e.g, a triangle for three source poses).
A second aspect of the present invention is directed to further modifying constructed poses to provide for greater control over the form and action of computer-generated animated images undergoing some form of motion or transformation, which may be specified as a distortion or. "warp" of one or more line segments of a drawing. A point within the drawing is chosen as a reference point, referred to herein as a "warp handle," which will typically be on a line segment of a source pose, but need not be so located. A motion path relative to this reference point --referred to herein as a "warp path" -- is then drawn in the drawing space.
The warp path defines a motion path in time relative to the reference warp handle, thus generating a set of relative x, y, and z displacements as a function of time. The line segment or segments to be modified by the warp path are then specified by any one of a number of methods, such as pointing and clicking with the drawing wand. In addition, a graph is drawn which defines the degree to which the successive points on the line SU9STITUTE SHEET (RULE 26) segment or segments are displaced by the warp path. This graph is referred to herein as a "warp profile graph." The set of relative displacements is then applied to the designated segments, as modulated by the warp profile graph. This general technique, referred to herein as "segment warping,"
may be modified to create various effects, such as the effect on an object of wind, of inertia, and to create the movement of a wave along the specified segments.
A third aspect of the present invention, referred to herein as "spine warping," creates a number of related segment warps simultaneously. This is accomplished by defining, on each source pose, a single, straight line "spine" extending approximately through the centerline of a group of line segments to be warped. Any of the above-described warps may be applied to the spine and the resulting warp of the spine is appropriately transferred to each point on each of the affected line segments in the group. This provides the animator with a tool for very simply specifying complicated transformations to groups of Iine segments simultaneously.
A final aspect of the present invention relates to the automatic painting of closed loops (which may represent a surface of an object in a stereoscopic viewing system) drawn in two or three dimensional space by "flood-filling" the loop (each of the two-dimensional left and right eye projections of the loop in a stereoscopic system). Flood-filling is a technique known in the art of computer graphics. The system and method of the present invention uses a different technique for painting closed loops, referred to herein ad "fill masking." In accordance with the present invention, the animator need only define the color with which the Ioop is to be filled in a single source pose and the color is maintained in each constructed pose regardless of the distortions the loop undergoes during motion. For each such constructed loop, a two-dimensional geometric shape, which is typically a rectangle, is generated automatically to encompass the loop by making it slightly larger than the loop based on the minimum and maximum x and y coordinates of the SUBSTITUTE SHEET (RULE 26) _7_ Loop. The entire rectangle is generated in the fill color of the loop chosen by the animator. Next, the Loop outline is transferred to the rectangle in its chosen line color or colors. A "fill" of the area bounded by the rectangle and the line forming the exterior of the loop is then performed, using the t 5 traditional flood-fill technique. This filled area is defined to be transparent so that when the resulting rectangle is displayed, the viewable image consists only of the Ioop in the appropriate filled color. This process is automatically repeated for each of the filled loops which comprise the complete character or object animation. .
Brief Description of the Drawings Figs. 1(a)-(d) illustrate four source poses of a fish for use in an animation sequence.
Figs. 2(a)-(d) illustrate the four source poses of the fish's mouth of Fig. 1.
Fig. 3 is a three-dimensional tetrahedral pose transformation space used to generate the transformation graphs of the present invention.
Fig. 4 is a transformation graph of the present invention for the mouth of a fish drawn in the pose transformation space of Fig. 3.
Fig. 5 is a transformation graph of the present invention for the eye brows of a fish drawn in a three-dimensional tetrahedral pose transformation space.
Fig. 6 is a transformation graph of the present invention for the body and fins of an animated fish, using only two vertices for a three-dimensional tetrahedral pose transformation space.
Fig. 7 is a transformation graph of the present invention for the eyes of an animated fish, using only two vertices for a three " dimensional tetrahedral pose transformation space.
Figs. 8(a)-(f) illustrates the animation frames resulting from " the combination of the transformation graphs of Figs. 4, 5, 6 and 7.
Figs. 9(a)-(d) illustrate the velocity profiles for the transformation graphs of Figs. 4, 5, 6, and 7.
Figs. 10(a)-(d) illustrate the velocity profiles for the SUBSTITUTE SHEET (RULE 26) _g-transformation graphs of Figs. 4, 5, 6, and 7 adjusted by the use of sync points.
Figs. lI(a}-(f) illustrate the advantage of using match points in constructed poses.
Figs. I2(a)-(b) illustrate the segment warp technique of the present invention.
Figs. 23 illustrates a warp profile graph used for the segment warps shown in Fig. 12(a).
Fig. I4 illustrates the resulting motion created by the segment warp defined by Figs. 12-13.
Fig. 15 illustrates an angel wing as an example of the problems with prior art in-betweening systems.
Figs. 16(a)-(c) illustrate how the problem of Fig. 15 is corrected using the segment warp technique of the present invention.
Fig. ,17(a)-(f) illustrate the wind effect that can be achieved using a variation of the segment warp of the present invention.
Figs. 18(a)-(e) illustrate the wave effect that can be achieved using a further variation of the segment warp of the present invention.
Figs. I9(a}-(b) illustrate the spine warp of the present invention.
Figs. 20(a)-(c) illustrate the problems with prior art seed point and flood-fill techniques for filling loops with color.
Figs. 21{a)-{c) illustrate the fill masking technique of the present invention for overcoming the drawbacks of prior art seed point and flood-fill techniques.
Detailed Description of the Invention The invention utilizes computer systems for drawing and viewing stereoscopic (three-dimensional) images and applies such systems to the field of computer-assisted animation. Systems for drawing in three-dimensional space are known in the art of computer graphics. One example of such a system is described in Schmandt, C., "Interactive Three-dimensional Computer Space," SPiE Vol. 367, pp. I55-59 {1982). The SUBSTITUTE SHEET (RULE 26) system described therein utilizes an ordinary CRT display monitor which is viewed by the user through a half-silvered mirror placed at a 45°
angle with the monitor. The user is provided with a three-dimensional drawing space beneath the mirror and a "wand" for drawing in the three dimensional space. The wand used in the described system utilizes magnetic position sensing technology to provide its x, y, and z position as well as its attitude. The three dimensional (stereoscopic) effect is achieved by the user viewing the CRT through special glasses utilizing lead lanthanum zirconate titanate (PLZT) ceramic wafers which function as electrically operated shutters. The left and right eye views are effectively time-multiplexed by displaying them on alternate raster scans. The operation of the glasses is synchronized with the video signal to allow one eye at a time to view the proper image on the CRT providing the three-dimensional effect. This technique is sometimes referred to as field sequential three-dimensional imaging.
An alternate means for providing a three-dimensional view is through the use of anaglyph (two color) Left and right eye image separation. A limitation of this implementation is that the drawn images are monochrome, whereas the field sequential technique allows for color images. A third means for providing left and right eye image separation is through the use of polarizing filters where the left eye image is polarized one way and the right eye image polarized another. The polarized images are normally viewed b~~ projecting them onto a screen and viewing them through appropriately polarized glasses. Although the invention has application to both two and three-dimensional computer-assisted animation systems, the invention will be described herein with regard to three-dimensional animation. It will be readily apparent to (hose of ordinary skill in the art that the same concepts may be applied to standard two-dimensional animation.
The present invention requires a three-dimensional stereoscopic viewing system using one of the above techniques to permit the animator to draw directly in three-dimensional space. In a preferred SUBSTITUTE SHEET (RULE 26) - 1~ -embodiment, the three-dimensional drawing and viewing system utilizes a computer workstation monitor and field sequential left and right image separation using synchronized liquid crystal shutter glasses.
The animator uses an electro-mechanical device referred to as a drawing "wand" to draw the three-dimensional drawings. The wand is actually a three-dimensional location tracker, which is available from several suppliers, including Ascension Technologies, Inc. In one embodiment of the present invention, a drawing wand referred to as the "Flock of BirdsTM" by Ascension is used. The device uses electromagnetic waves to provide its position and orientation in three-dimensional space.
Liquid crystal shutter glasses are available from, among others, Stereographics Corp. A high resolution 17-inch monitor by Nanao has been found to the best from the standpoint of image resolution and stability as well as ease of use. When the user moves the wand in space a cursor moves within the drawing space under control of the wand and when a button on the wand is pushed, a continuous line in three-dimensional space following the path of the cursor is drawn. The line is composed of a series of closely-spaced points joined by ver~.t short line vectors to form what appears to be a single, continuous smooth line. It is important that the system provide for vector-based as opposed to bit-rnapped drawings, so that the line segments drawn by the animator may be . mathematically defined and processed by the computer.
The present invention relates more specifically to several novel ways for transforming only a few drawings to create animation sequences. The invention incorporates several techniques for creating computer-assisted animation that are simple for an animator to use and provide the animator with control over the form and motion of animated objects that is lacking in existing computer animation systems.
In general, animation consists of the transformation of images in time to create the appearance of motion. The invention discloses se~Teral techniques for generating transformations in a manner that is simple and intuitive to use for an animator, and which also provides the animator with a great degree of control over the way in which images are transformed in order to provide realistic, life-like motion.
The first aspect of the invention relates to a concept referred to as transformation graphs which permit the animator to simply and intuitively generate different, computer-constructed poses of animated objects based on source poses drawn by the animator. A three-dimensional transformation graph may be implemented as follows (although two-dimensional graphs may also be used). The animator is provided with an image through the three-dimensional viewing system of a polyhedron, such as a tetrahedron. The tetrahedron is shown in the three-dimensional drawing space using well-known techniques for generating and displaying left and right eye two-dimensional images to create a three-dimensional effect. The tetrahedron displayed is only a guide for the animator and does not become part of the drawings used in the animation. Each of the four vertices of the tetrahedron is defined to represent a source pose hand-drawn by the animator. Each source pose consists of a vector-drawn representation of an animated object or portion of an object. Alternatively, source poses may be generated by prior-art computer animation systems and utilized in the present invention.
For example, four poses of a figure can be drawn, each with different positions of the Iegs. The four poses may then be represented at each of the four vertices of the tetrahedron. These four poses themselves are not sufficient to realistically represent motion. A sufficient number of poses to create realistic motion axe constructed from these four poses.
These constructed poses are based on composites of the four source poses.
The constructed poses are defined by the animator by moving the wand in the three-dimensional space within the tetrahedron, referred to as the pose '~ transformation space. The motion of the wand is tracked in time as it is moved within the tetrahedron and a three-dimensional graph of the wand's position traced out within the pose transformation space is generated. Each point on the graph represents a pose constructed from the SUBSTITUTE SHEET (RULE 26j WO 97!24696 PCT/CA96/00881 four source poses. The number of points depends on the sampling rate of the drawing wand. The generation of constructed poses in this manner provides for continuous transformations of images in a manner simple ,, for the animator to use. The animator "scripts" the action of a character or object simply by moving the wand cursor within the transformation space.
The graphs so created are referred to as transformation graphs because they define a continuously transforming series of poses constructed from the source poses. Different actions of the figure can be generated by different paths of the wand cursor in the transformation space. For example, with one set of four source poses with different positions of the legs, the figure referred to above can .be made to "mark time," walk forward, walk backward, walk with big steps, little steps, etc., and these actions can be continuously created in any sequence simply by manipulating the wand. The transformation graphs are generated as I5 follows. Using the example of a tetrahedral drawing space, at each point along the transformation graph, the constructed pose associated with the point is defined by the location of the point in space relative to the four vertices of the tetrahedron. The closer the point is to a vertex, the more the source pose assigned to the vertex will affect the appearance of the constructed form. In one embodiment, a simple linear weighting scheme is used so that the weight of each vertex or source pose is inversely proportional to the distance from the graph point to the vertex. For example, if a graph point is, in three-dimensional space, a distance x away from the first vertex (v1), 2x from the second (v2), 3x from the third (v3), and 4x from the fourth (v4), each of the four source poses associated with the four vertices will be weighted accordingly. In other words, the points defining the line segments of the constructed pose will be placed in accordance with a weighted average of the positions of the points in each of the four source poses. It should be noted that, utilizing the transformation graphs of the present invention, the source poses need not actually be part of the resulting motion sequence, which may utilize only composites of the source poses. In other words, the transformation graph SUBSTITUTE SHEET (RULE 26) WO 97/2469b PCT/CA96/00881 need not anywhere touch a vertex. It should also be noted that, unlike the key poses of prior transformation techniques, there is no predefined time sequence for the poses. The transformation graph can move through any path in the pose transformation space in any sequence desired by the animator.
In a preferred embodiment, the tetrahedron is modified so that each edge is not a straight line but the arc of a circle centered at an opposite vertex and with a radius equal to the length of one side of the tetrahedron. The reason for this is as follows. Each vertex represents, by definition, a source pose, so that the weight of any of the other three vertices is defined to be zero at that vertex. In other words, the contribution of a source pose goes to zero when the distance of the vertex to which that pose is assigned to the point on the transformation graph is equal to the length of an edge of the tetrahedron. If an edge of the 25 tetrahedron is traversed, the resulting constructed pose will be composed primarily from the two vertices at each end of the edge. However, the remaining two vertices will have non-zero effects because the distance to these vertices will diminish as the edge is traversed. Thus, it would not be possible to script a motion sequence constructed from only the two source poses represented by the two vertices at each end of the edge. Although in most cases the contributions of the other two vertices might not be noticeable in the resulting animation, any such potential problem is solved by utilizing the circular arcs in order to maintain a constant distance from each of the two non-contributing vertices as a path between the two vertices at the ends of the arc is traversed. It ~n~ill be apparent to those of ordinary skill in the art that the shape of the transformation space need not be exact as it is only intended to be a guide for the animator in scripting action sequences. The system may readily be programmed so that if, for example, the animator moves the wand slightly inside or outside the tetrahedron as opposed to following precisely along the edge, it will be recognized as motion that is comprised only of the two source poses at the vertices.
SUBSTITUTE SHEET (RULE 26) The transformation graph aspect of the invention may be further described with reference to the figures. Figs. 1(a)-(d) illustrate four possible configurations for the facial expressions of an animated fish. For clarity, the fish is drawn without illustrating the z-component and therefore appears two-dimensional, but is meant to depict a fish in a three-dimensional stereoscopic drawing. As can be seen in Fig. 1, there are four different source poses for the fish's mouth as shown in Fig. 2 -- frown (Fig.
2(a)), smile (Fig. 2(b)), small mouth (Fig. 2(c)), and big mouth (Fig. 2(d)).
In each of Figs. 2(a)-2(d), four points, A-D are shown. Each of the four source poses of the mouth may be assigned to one of the vertices (labelled a, b, c, and d) of a tetrahedron shown in Fig. 3 consisting of four planes: abc, bcd, acd, and abd. For example, at a point m midway along the line cd, the constructed pose defined by this point (a medium-sized mouth) will be formed primarily from the source poses at vertices c (small mouth) and d (large mouth). Each of the points A,B,C, and D in Figs. 2(c) and 2(d) (as well as all the points along the line segment) will be mapped to a location (x,y coordinate) approximately midway between their locations at the vertices c and d.
Fig. 4 illustrates a transformation graph drawn by the animator (using the wand) which controls the transformation of the shape of the mouth. Starting at point S (which is essentially a frown) lying approximately in the plane defined by vertices abc, the transformation graph progresses toward vertex c to point 1, then toward vertex b to point 2, then upward along the line bd to point 3, then downward on the plane abd to point 4, then along the line ab to the end point E. Although the transformation graph is shown essentially along the surfaces of the tetrahedron for purposes of illustrating it in a two-dimensional drawing, '"
the graph may be drawn through any part of the volume enclosed by the tetrahedron. As the animator draws the path, the computer calculates, based on the sampled position of the wand in space, the location of the cursor from each vertex and then draws the resulting constructed pose. A
subset of the points (every nth point) making up the constructed pose is SUBSTITUTE SHEET (RULE 26j selected for display so that the series of constructed poses can be seen in real time and the animator can view the motion he is scripting. This is done essentially in real time so that the animator can view the motion he is scripting as he moves the wand to control the cursor movement. Fig. 5 - 5 illustrates a three-dimensional transformation graph for another element of the fish drawing, the eye brows, Fig. 6 for the fish's body and fins taken together, and Fig. 7 for the eyes. In Fig. 6, there are only two source poses used at i and j. The other two vertices, k and I, are also assigned the pose assigned to vertex i as a programming convenience. The transformation graph could actually be scripted along a one-dimensional line as only two source poses are used. The same is true for Fig. 7, which illustrates the transformation graph for the eyes along the line m-n, although tetrahedron mnop is shown.
If a sequence using only three source poses is to be generated, a triangle on a plane may be used as the pose transformation space.
Similarly, a sequence using only two poses can be scripted on a pose transformation space consisting simply of a line with one pose assigned to each end of the line. On the other hand, if more complicated motions are to be scripted using a greater number of source poses, the pose transformation space may be readily extended by utilizing the existing capability of the drawing wand to sense orientation. Each of the three components -- pitch, roll, and yaw -- may represent an additional source pose thus providing three additional source poses. This allows for a six dimensional pose transformation space in which any possible combination of seven source poses can be defined. Other inputs, such as foot-pedals, could provide for additional source poses. In such a case, the cursor in the pose transformation space would only reflect four poses; the degree of effect of the other inputs could only be seen in the resulting constructed pose.
In addition to controlling how the poses of animated objects change, the transformation graphs are also used to control the rate of transformation, which correlates to the apparent speed of the action SUBSTITUTE SHEET (RULE 26) produced in the animated object in the resulting animation sequence.
Because the drawing system is sampling the position of the wand at a fixed rate, the position of the wand as a function of time is known. Therefore, , the rate of movement of the wand is known and may be used to control the rate or speed of the scripted transformation.
When a transformation graph is drawn, the points of the graph axe stored. These graph points are equally spaced in time.
Therefore, the spacing of graph points in the pose transformation space depends on the speed with which the animator moves the drawing wand and their spacing controls the rate of change of the animated action. If the animator draws the graph in real time, each point may correspond to a frame of animation. Alternatively, the animator may first define the number of frames desired for the sequence and then draw the graph in "slow motion." In this case, the number of frames in the animation sequence will be less than the number of graph points generated.
Similarly, the transformation graph may be drawn faster than real time so that the number of frames will be greater than the number of graph points.
In these latter two cases, the transformation graphs are interpolated accordingly, to create the number of frames selected by the animator. The stored frames may then be played back at the rate at which they will be seen by the viewer (which is typically 24 or 30 frames per second) so that the animator can determine if the speed of the motion is appropriate.
They can also be played back at faster and slower frame rates for analysis.
To facilitate adjustments to the speed of the action, the animator is provided with a graphical representation of the rate of transformation of the poses throughout the sequence of poses, referred to herein as a "velocity profile" for the transformation graph. The velocity profile shows the relative rate of change of the poses along the transformation graph. Without changing the sequence, the animator can adjust the velocities along the transformation graph using, e.g., a point, click, and drag action known in the art to modify the velocity profile, or by redrawing the velocity profile entirely. When the velocity profile is so SUBSTITUTE SHEET (RULE 26) changed, the spacing of the transformation points along the transformation graph is adjusted by interpolation in such a manner that the animation sequence still occurs over the correct number of frames.
a For example, if the relative speed of the action is increased in a portion of the transformation graph, it will be appropriately decreased in the remaining portion of the transformation graph.
Figs. 8(a)-(f) illustrate the frames of animation resulting from the combined transformation graphs in Figs. 4, 5, 6 and 7. In Fig. 8(a) (point S on the transformation graphs}, the fish is approaching a piece of food which he notices in Fig. 8(b) (point 1). The sequence then continues until the fish swallows the food. Figs. 8{c} through 8(f) correspond to points 2, 3, 4, and E in Figs. 4, 5, 6 and 7. The points relate to different frames of animation, i.e., different points in time during a transformation sequence. For example, as shown in Figs. 8(a)-(f}, times 0, l, 2, 3, 4, and E
may correspond to frames 1, 40, 90, 150, 180 and 240, respectively.
Fig. 9(a)-(d) show the velocity profiles of the transformation graphs for the mouth, eyebrows, body, and eyes, respectively, which are illustrated in Figs. 4-7, as they might be after recording the respective transformation graphs. The x-axis indicates time or number of frames and the v-axis the instantaneous rate of transformation of the constructed poses. A zero rate of transformation means that the image is static; a flat, npn-zero rate that the image is transforming at a constant rate, a positive slope means that the rate is increasing and a negative slope that the rate is decreasing. For each velocity profile in Figs. 9(a)-(d), six points are shown, i-vi, each corresponding to a frame in an animation sequence. For each of these points, the legend adjacent to each of the graphs indicates the pose associated with the frame. The velocity profiles of Figs. 9(a}-{d} may be displayed after an animator has generated the respective transformation graphs to indicate the rate of transformation as drawn by the animator.
Note that as shown, the points i-vi do not correspond to the same frame in each of the four velocity profiles. The animator may manually modify the profile by "nudging" (using the wand cursor to push parts of the graph SUBSTITUTE SHEET (RULE 26) into a different shape) a portion of the graph or by redrawing the entire graph to adjust the transformation rate as desired.
If all the transformations in a drawing are controlled by the n same transformation graph, the effect may be mechanical and not Iife-like.
By dividing a drawing into groups and drawing a separate unique transformation graph for each, a complex life-like action can be created.
However, when a composite drawing is generated from different groups of elements controlled with different transformation graphs, there may be a need to coordinate the action of the different groups before they are compiled into frames of animation. For example, as originally drawn, the velocity profiles for the mouth, eyebrow, body, and eye transformations are as shown in Figs. 9(a)-(d). It may be seen in Figs. 9(a)-(d) that these velocity profiles produce constructed poses of the mouth, eyebrows, body, and eyes that are not synchronized in time compared to the desired relationships of the different body parts as shown in Figs. 8(a)-(d). The differences are exaggerated for clarity. For example, at the point where the mouth of the fish is large, the eyes and eye brows must be portrayed as squashed toward the top of the head of the fish. As originally produced (as shown in the unmodified velocity profiles of the transformation graphs), the mouth is large at point iv in Fig. 9(a), approximately frame 80, while the eyes and eyebrows are squashed at frames 60 and 140, respectively. The present invention facilitates the synchronization of the actions of different groups of elements as follows. While drawing the transformation graph for, e.g., the eyes, the animator may simultaneously view the played-back action of the mouth, which was scripted using a transformation graph and stored. In this manner, the animator may manually synchronize the actions of the elements. Repeated "takes" may be used until the animator is satisfied with the synchronization. The playback may be in real time or, if desired, in slow motion to facilitate synchronization.
Alternatively, this may be done using the concept of synchronization points or "sync" points. Sync points are used to specify that at a particular point in time during a sequence (i.e., a particular frame SU~STITUTE SHEET (RULE 26) of animation within a sequence of frames), a group of elements will have a selected form, such as the open mouth of the fish. In a preferred embodiment, a frame identifier is first assigned to the designated frame (point in time) where the sync point will occur. Next, the constructed pose to be assigned to the selected frame is chosen by using a pointing device (such as the drawing wand) to scroll along a linear scroll bar representative of the entirety of the transformation graph. As the animator moves the cursor along the scroll bar, the constructed pose corresponding to that point on the transformation graph is displayed. in addition, the position of the cursor on the actual transformation path is displayed as well. When the desired constructed pose is displayed, a wand button is clicked to indicate that that pose is to be synchronized with the selected frame.
In a second group of elements to be coordinated with the first group, the corresponding constructed pose (i.e., squashed eyes) is chosen by the animator in the same manner. This pose is assigned the same frame identifier as the frame in the transformation graph for the mouth so that it too is synchronized with the selected frame. In this manner, the selected mouth pose and the corresponding eye pose will occur in the same frame and therefore the same point in time. The sequence of poses along the transformation path is not affected. However, in order to force a selected pose to occur at a particular time, the velocity of the transformation must b~ adjusted. This is done by reducing or expanding the number of frames bet~n,~een each sync point, as required. This is done by interpolation, so that in so fax as possible the original velocity profile is maintained. However, depending on the velocity profiles, it may be difficult to maintain the shape of the velocity profile in the vicinity of one or more sync points without creating a discontinuity in the motion. In this case, the resulting animation sequence may be played back to determine if there is a discontinuity noticeable to a viewer. In general, sudden changes in the velocity of a transformation are not detectable by the viewer. However, if it is, the shape of the velocity profile may be adjusted or re-drawn by the animator to eliminate the discontinuity. It is likely that there will be SUBSTITUTE SHEET (RULE 26) multiple sync points used along a transformation graph. The same procedure is followed for each such point.
Figs. 10(a}-(d) illustrate the sync point concept. The sync points are labelled SP1-SP4. These might, for example, correspond to frames 40, 90, 150, and 180 as shown in Figs. 8(a)-(f). Fig. 10(a) is the velocity profile for the transformation graph for the mouth of the fish and Figs. 10(b}-(d) the eyebrows, body, and eyes, respectively. As in Figs. 9(a}-(d), the velocity profiles in Figs. 10(a}-(d) correspond to the transformation graphs of Figs. 4-7, respectively, but in this case have been re-generated using sync points. In the animation sequence, the large (wide open) mouth must occur when the eyes of the fish are squashed towards the top of its head and the small mouth when the eyes are wide open. Therefore, point SP1 along the transformation graph is assigned to the point in time when the mouth is small and point SP3 when the mouth is Large. The velocities along-- thetransformation graph aye the,~adj»sted (by interpolation) so that point ii in Fig. 9(a) (small mouth) has been shifted later by 20 frames, and point iv (large mouth) has been shifted later by 70 frames, to occur at frames 40 and 150, respectively. Similarly, point SP2 (frame 90) is assigned to the point in time when the first smile occurs and SP4 (frame 180) when the second smile occurs (points iii and v in Fig. 9(a), respectively). All the other elements are similarly adjusted, so that proper synchronization occurs, as shown in Figs. 10(a)-(d), and the desired relationships of the different features as shown in Figs 8(a)-(f) are obtained.
Sync points may also be used to properly synchronize the action within a constructed pose transformation sequence to a sound track.
Segments of the source poses may be mapped onto one another using match points to avoid undesirable constructed poses. The ' use of match points is known to those of ordinary skill in the art and is briefly described as illustrated in Fig. 11. Match points break up lines into ' segments so that the weighted averaging discussed above to calculate point locations occurs along corresponding segments in each pose. Figs. 11(a)-(c) represent a profile view of a character's head with a growing nose. Of SUBSTITUTE SHEET (RULE 26) - 23. -course, the intention is that the head maintain the same shape as the nose grows. However, if the source poses shown in Fig. 11(a} and 11(c} are used to generate the constructed pose in Fig. 11(b}, the image is distorted. In order to prevent such distortion, match points A and B are assigned as shown in Figs. 21(d)-(f) so that the proper shape of the head is maintained in the constructed pose Fig. 11(e). The match points cause the weighted averaging to take place along two related segments of the source poses.
Therefore, because the head portion has the same form in the two source poses in Figs. 11(d) and 11(f), the head is also the same form in the constructed pose. Match points C and D shown in Figs. I I (d)-(f) cause the nose to maintain its shape as it elongates and shrinks. Without these points, the nose could appear somewhat pointy as in Fig. 11 (e) at some point in the transformation.
Table 1 is one embodiment of the pseudo-code for calculating a constructed pose from the four source poses of a tetrahedron. Table 2 is one embodiment of the pseudo-code for creating an animated sequence from the source poses and a transformation graph.
Table 1 Const T"TaxT~ineLength = 1000;
i ********* Definition of a Point ********** ]
Type PointType =
Record X, Y, Z : Single;
E'nd;
c ********* Definition Of a Line ********** ]
- Type LineType =
Record NoOfPoints : Integer;
r Point : Array [l..MaxLineLength] of Point Type;
sa ~d;
{******************************************************************************
}
]
SUBSTITUTE SHEET (RULE 26) { The following routine calculates a constructed pose from four source poses.
}
{ }
{ It has two different uses : 1) for visual realtime feedback when the animator}
{ is creating the transformation graph and Z) as a subroutine when playing back}
{ the recorded animation sequence for animator review. } ' { ) { This simple example works for drawings made up of a single line; it would be }
{ put in a larger loop for a multi-line drawing. }
{ The four source poses must previously have been "aligned" (ie. they each must}
1~ { contain the same number of points and point N in pose A must correspond to }
{ point N in poses B, C and D. This is done using "Match Points." }
{ }
{*w****w*******x**************w*********************************x**********xx**
}
Procedure CalculatePose (va. PoseA, PoseB, PoseC, PoseD : LineType; { The four source poses }
Var CalcPOS : PointType; { Pos. in tetrahedron to calc. for}
Va= DestPose : LineType); { Resulting pose }
{ Local function to get distance from the point to a vertex of the tetrahedr.}
Function Dist:oVertex (Var P1, P2 : PointType) : Single;
Begin DistToVerte~: := Sqrt ((P1.X - P2.X)~2 + (P1.Y - P2.Y)~?. + (pl.Z - P2.2)~2);
tea;
Var DistA, Dist~, DistC, DistD, TotalDist : Single;
Proportion . ProportionB, ProportionC, ProportionD, PropScaling : Single;
Begin {************'" Get Distance to each Vertex }
DistA := Dist':'oVertex (CalcPos, VertexA); {Assumes vertices defined elsewhere}
DistB := DistToVertex (CalcPos, VertexB);
DistC := DistmaVertex (CalcPos, VertexC);
DistD := DistToVertex (CalcPos, VertexD);
{*********w**'x Use them to calc. contributing proportion of each source pose}
TotalDist :- DistA + DistB + DistC + DistD;
ProportionA := TotalDist / DistA;
ProportionB := TotalDist / DistB;
ProportionC := TotalDist / DistC;
ProportionD := TotalDist / DistD;
{*******w****'* Scale the proportions to total one }
PropScaling := ProportionA + ProportionB + ProportionC + ProportionD;
ProportionA := ProportionA / PropScaling;
SUBSTITUTE SHEET (RULE 26) ProportionB := ProportionB / PropScaling;
ProportionC := ProportionC / PropScaling;
ProportionD := ProportionD / PropScaling;
{************** Calculate the new pose }
'3r DestPose.NoOPoints PoseA.NoOfPoints;
:=

For I := 1 to PoseA.NOOfPoints do Begin DestPose.POint[I].X:= ProportionAPoseA.Point[IJ.X
* +

ProportionB PoseB.Point[I].X
* +

ProportionC PoseC.Point[I].X
* +

ProportionD PoseD.Point[I].X;
*

DestPose.Point[IJ.Y:= ProportionAPoseA.Point[IJ.Y
* +

ProportionB PoseB.Point[I].Y
* +

ProportionC PoseC.POint(I].Y
* +

25 ProportionD PoseD.Point[I].Y;
*

DestPose.Point(I}.Z:= ProportionAPoseA.Point[I}.Z
* +

ProportionB PoseB.Point[I].Z
* +

ProportionC PoseC.Point{I}.Z
* +

ProportionD PoseD.Point(I}.Z;
*

Ena;

Ena;

Table 2 { ********* Definition of a Line ********** }
Type LineType =
Record NoOfPoints : Integer;
Point : Array [l..MaxLineLength] of PointType;
End;
{ ********* Definition of all Animated Sequence ********** ]
Type AnimatedseqType =
Array [l..NoOfFrames] of LineType;
{***w******w***********************************w*w*w*w*wwwwwww***ww************
}
{ }
{ This routine computes the frames of composed animation from four source }
3'Jr { poses and a transformation graph. 3 { ?
{**w*w**wwww**w*w-nrwwww*w*wwwww**w*****ww*ww*********ww*w*****w*ww*ww*****w*****}
SUBSTITUTE SHEET (RULE 26) Procedure CreateSequence iVar PoseA, PoseB, PoseC, PoseD : LineType; { The four source poses }
Var TransGraph : LineType; { Trans. Graph is just a line}
NoOfFrames . Integer; { Number of frames to create }
Var DestSequence : AnimatedSeqType); { Resulting sequence }
Var FramePoints : LineType;
Begin (************** Convert T-Graph to an array of Frame Points based on timing }
1~ FramePointsFromTransGraphTiming (TranformationGraph, NoOfFrames, FramePoints);
(************** Allow user to adjust the timing manually }
While not CheckIfUserHappy (FramePoints) LetUserFixCunre (FramePoints);
(************** Calculate each frame }
15 For I := 1 to NoQfFrames do CalculatePose (PoseA, PoseB, PoseC, PoseD, FramePoints[Ij, DestSequence[Ij);
End;
{*******w**w**w************ww*****************w*****w*****************ww*******
}
}
2~ { Sub-routine to convert a transformation graph to an array of Frame Points. }
( Each frame point is a point on the same 3-space line as the Transformation }
( Graph, distributed along the line so that the action timing appears natural.
}
( }
(w****w**w*w*www*****wwwww*******w**w***w*********www**********w************ww*
}
25 Procedure TrnnsGraphToFramePoints (Var TransGraph : LineType; { Transformation Graph }
NoOfFrames . Integer; ( Number of frames needed }
Var FramePOints : LineType); ( Frame points created j var Units : Integer;
Fraction, PointToUse : Single;
Begin FramePoints.NoOfPoints := NoOfFrames;
(************** First and Last Points are fixed }
FramePoints.Point[lJ .= TransGraph.POint'[lj;
35 FramePoints.Point[NoOfFrames} := TransGraph.Point[TransGraph.NoOfPOints};
(************** Start by using the timing from when Trans. Graph was drawn }
For I := 2 to NoOfFrames - 1 do SUBSTITUTE SHEET (RULE 26) Begin { Find a point partway along some line segment in the Trans. Graph]
PointToUse : (I-1)/(TransGraph.NoOfPoints-1); { A real number ]
Units .= Trunc (PointToUse);
Fraction := PointToUse - Units;
FramePoints.POirit[I].X := TransGraph.POint[Units].X +
Fraction * (TransGraph.Point[Units+1]_X - TransGraph.Point[Units].X);
FramePoints.Point[I].Y := TransGraph.Point[Units].Y +
Fraction * (TransGraph.Point[Units+1].Y - TransGraph.Point[Units].Y);
FramePoints.Point[I].Z := TrsnsGraph.Point[Units].Z +
Fraction * (TransGraph.Point[Units+1].Z - TransGraph.Point[Units].Z);
End;
End;
The system and method of the present invention also provides for the tying together of different, separately transformed groups of Iine segments by specifying an attach point on one group of elements to which another group is connected. This feature is useful in the case where different groups of elements experience different motions, but one group is in reality attached to the other, such as in the case of the head and body of a person. This feature is implemented by specifying a first group of elements as the master and a second group as the slave. In the above example, the master would be the body and the head the slave.
Techniques for relating the locations of animated groups in this manner are known to those of skill in the art in the field of computer animation.
If an animation sequence requires a very complex set of actions to be scripted -- more than can be constructed from a convenient number of poses -- a transformation graph through two or more pose transformation spaces may pass through a common vertex of the tetrahedra to generate a continuous motion sequence. In this manner, for example, an action is scripted inside a first tetrahedron and then through a vertex which is common between a first tetrahedron and a second - tetrahedron (which have a common source pose at that vertex). The animator then continues the transformation graph in the second tetrahedron which has three different source poses associated with its other vertices. Similarly, the second tetrahedron may connect with a third SUBSTITUTE SHEET (RULE 26j tetrahedron and so forth. Linking of pose transformation spaces in this manner enables complex series of actions to be defined by one continuous "script." In addition to linking pose transformation spaces at a common vertex, the endpoint constructed pose of a motion sequence, ~n,~hich need not be a source pose, may be used as one of the source poses in the transformation space for a second motion sequence. The transformation graph for the second motion sequence is started at the vertex associated with that source pose, so that the acfion is continuous and seamless when the two sequences are joined together.
The transformation graphs may be stored and are not uniquely associated with specific source poses -- the same transformation graph representing, e.g., a walking action, may be applied to control the animation sequence for different sets of source poses representing different characters. Similarly, source poses can be stored for use with different transformation graphs.
The animation sequences generated by the transformation graphs may themselves be represented in a tetrahedral transformation space in order to generate a single output animation sequence. For example, four different perspective views (e.g., 90° apart) of a walking action may be created by generating four sets of constructed poses. The four sets of constructed poses may be generated by drawing a transformation graph for one of the perspective views, using four source poses for that perspective view, and then using the same transformation graph for each of the other three pose transformation spaces associated with the other three perspective views. In this manner, synchronization of the four sets of constructed poses is automatic.
Each set of constructed poses is then assigned to one vertex of a tetrahedron, which in this case may be considered a perspective transformation space rather than a pose transformation space. Rather than each vertex representing a single, fixed source pose, the source pose at each vertex varies as a function of time, i.e., it is determined by the constructed pose for that vertex at any given point in time. A
SUBSTITUTE SHEET (RULE 26j _27_ transformation graph is then drawn within this tetrahedron to specify the contribution each constructed pose makes at each point in time during the transformation, to the final single constructed pose at that point. At each point along the transformation graph, the final constructed pose is ~ 5 determined by a composite of the four source poses, except that each source pose actually represents a different perspective of the same pose.
Therefore, the movement of the wand only changes the perspective of the action, not the transformation of the object itself, which has already been defined by the sets of constructed poses. In this manner, a transformation graph can be generated representing a continuous walking action with a continuous change of the viewer's perspective on that action to simulate, for example, a camera panning around an object.
The aforedescribed transformation graph technique for scripting motions is a significant improvement over existing computer animation systems. Simply by manipulating a wand in a three dimensional drawing space, an animator can create long and complex motions using a user interface that allows such motions to be generated in an intuitive manner as a "performance," somewhat as a puppeteer would control the actions of a puppet, and to view the motion in real time. The advantage of this technique is most significant in three-dimensional computer-assisted animation, where creating even a single pose, much less an entire sequence, using existing techniques is complicated and time consuming. For two-dimensional animation, the technique may be used to produce long sequences of two-dimensional animation with little effort.
In typical computer animation systems, both the position in space and the transformation of an object are represented simultaneously in a pose. The system and method of the present invention provides the flexibility to separate the transformation of an object from its path in space.
In this case, the wand may be used to generate a path in space (referred to as a "space path") for a character or object separately from defining a pose transformation graph. The path in space has an associated velocity graph, which may be modified as described above by adjusting or redrawing it, or SUBSTITUTE SHEET (RULE 26) through the use of sync points.
A second aspect of the present invention is referred to as "segment warping" and is also directed to further modifying constructed poses to provide fox greater control over the form and action of animated images. Segment warps are described as follows. A point within the drawing space, referred to herein as a warp displacement reference point or "warp handle," is chosen, which will typically be on a line segment of a source pose, but need not be so located. The function of the warp handle is to serve as a reference point for a motion path relative to this point, referred to herein as a "warp path." The warp path is drawn by the animator in real time or in slow or fast motion. The warp path defines, for each segment or segments to be modified by the segment warp, the relative displacement of the warp handle from its starting point. The line segment or segments of a drawing to be modified by the warp path are then specified by any one of a number of methods, such as pointing and clicking with the drawing wand. In addition, a graph, referred to herein as a "warp profile graph," is drawn which defines the degree to which the successive points on the line segment or segments are displaced by the warp path.
The segment warp technique is best described with reference to a specific example. In the fish shown in Fig. 12(a), match points are placed on the fish body and tail at points labelled MP1, MP2, MP3, and MP4. A warp handle, H, is then placed on the segment between MP2 and MP3. The three segments, MP1-MP2, MP2-MP3, and MP3-MP4, are then identified as the segments to be warped. Fig. 12(b) illustrates the, warp path, shown as the dotted line with arrows indicating direction. In this example, the warp path represents the back and forth motion of a fish's tail and is represented by a series of arcs. The warp path is not part of the drawing itself and is not shown in the final animation. The path is shown moving toward the first extreme EX1, then toward an opposite extreme, EX2, then back toward the first extreme EX1 again. A warp profile graph is then drawn for the three segments as shown in Fig. 13. The warp profile SUBSTITUTE SHEET {RULE 26) graph defines the relative effect of the warp path of Fig. 12(b) on each successive point along the selected Iine segments. As shown in Fig. 13, the r effect of the warp on segment MP1-MP2 is zero at MP1 and increases to 90% at MP2, stays constant at 90% for segment MP2-MP3, and varies from _ 5 90% at MP3 to 0% at MP4 for segment MP3-MP4. This means that, for example, at any point in time, the displacement of the points along segment MP2-MP3 will be 90% of the relative displacement of the warp handle from its initial position at that point in time. In other words, if at a particular point during the warp the relative displacement of the handle from its initial position is 1.0 units of length in a z direction (into the paper), 0.4 units in an x direction (horizontal), and 0.1 units in a y direction (vertical), the displacement of alI the points along the segment MP2-MP3 from their initial positions will be 0.9, 0.36, and 0.09, respectively. The points along the segment MP1-MP2 will not be displaced at all at MP1, will be displaced progressively more towards MP2, until at MP2 the displacement is 0.9. The effect along MP3-MP4 will be reversed.
Because segment warps simply represent point displacements for the points along selected line segments, they are additive -- multiple segment warps may be applied to the same segment or segments.
The effect of the segment warp on the three segments is shown in Fig. 14. At point ExI, the tail is at its maximum displacement along the arc defined by the warp path. The end of the tail, segment MP2-MP3, is displaced to its maximum extent out of the paper (tow and the observer). Similarly, at point Ex2, segment MP2-MP3 is displaced to its maximum extent into the paper (away from the viewer.
Rather than defining a warp profile graph as shown in Fig. 13, the animator may specify the relative displacement of the points along the Iine segment in any of a number of ways, such as by varying the thickness, brightness, or color of the selected segment.
It will be recognized by those of skill in the art that the segment warp technique provides a powerful and intuitive tool for animators to create complex motions very simply. By specifying the warp SUBSTITUTE SHEET (RULE 26) handle on the vertical segment of the tail MP1-MP2 as shown in Fig. 12(a), the animator can, in effect, "grab on" to the tail with a drawing vaand and move it back and forth in real time, exactly as it is intended that the final motion should appear. Thus, subtle differences in the timing, direction, and extent of animated motions can be quickly and simply produced. The .
rate and coordination of the motion with other motions of the object (i.e., Transformations), may be controlled using the previously described velocity profiles and sync points.
A further example of the utility of the segment warping concept may be explained with reference to another application. In prior art computer animation systems, in-between frames are frequently generated by the computer by linearly interpolating between line segments in the drawings of the two source poses. However, interpolation can sometimes result in unrealistic motions. One situation where this occurs is where the motion between source poses is rotational and constructed poses are generated using linear interpolation. Fig. 25 illustrates the potential deficiencies of using simple interpolation to create ne'n~ poses.
The motion of an "angel wing" is illustrated in Fig. 25 showing the movement of an angel's beating wings. Point E is at the tip of the right wing and point B at the tip of the left wing. At Efl and BQ, the wings are at the top of their arc (at pose 1) and at B1 and E1, the bottom of their arc (at pose 2). The midpoints of . rotation of the wings axe at. B., and E2 respectively. In true rotational motion, the wing tips are at minimum x displacement at the top and bottom of the arc and at maximum x displacement at the midpoint. If the animator specifies only the top and bottom wing positions as shown in Fig. 15 as source poses, and the computer generates the constructed poses through linear interpolation, the result is that the wing will appear to shrink as it moves from top to bottom, as shown by the positions of the tips at BZ and E2 (dotted lines). Of course, additional source poses may be specified by the animator at intermediate positions between the extremes of motion of the wing, but the additional poses may be needed for creating other wing motions, for SUBSTITUTE SHEET (RULE 26) example, a twisting of the wings as they beat up and down.
The segment warp technique of the present invention solves this problem as described with reference to Fig. 16. As shown in Fig. 16(a), using the right wing as an example, match points are specified at points A, B, and C. A warp handle, WH, is then specified at point B, the wing tip. A
warp path, WP, shown as the dotted line, is drawn to specify the relative displacement of the warp handle.
The warp path shown is for one downward sweep of the wing from the top of its arc to the bottom. The warp profile is drawn as in Fig. 16(b). The segment warp specified by the warp path and profile graph is then applied in conjunction with the pose transformations of the angel wings, ~=hich are specified with a pose transformation graph, as described above. As the wing moves downward, the displacements specified by the warp path are applied to the points along the segments A-B and A-C in accordance with the warp profile shown in Fig. 16(b).
The result is that as the wing moves downward form pose 1 to pose 2 to pose 3, the points along the two segments are displaced so as to maintain the proper size of the wing during the transformation from pose to pose. The wing in effect is progressively stretched outward as it moves down so that the wing tip follows the proper arc, designated BI, B2, B3 in Fig. 16(c). The action of the angel with the wings moving up and down nay be scripted using the previously described transformation graph and velocity profile. This action may then be coordinated to the segment warp of the wing. As previously described, this may be done by drawing the warp path while viewing the transformation of the angel's wings or using sync points to control the velocity profiles so that, for example, the - maximum displacement of the warp from the reference point occurs when the wing is at the midpoint of the sweep downward of the wing.
If there are many beats of the wing, as would normally be the case, a single warp path (basically an outward and inward motion) is drawn, continuously, for each down beat and each up beat, and the warps are synchronized to the beats as described above. A similar segment warp SUBSTITUTE SHEET (RULE 26) WO 97!24696 PCT/CA96/00881 would be applied to the left wing as well.
The segment warp concept is a very powerful technique with many applications. For example, complex effects such as waves, wind effects, and acceleration effects may be readily achieved using this technique. Wind effects may be created as illustrated in Fig. 17. Fig. 17(a) .
illustrates a flag which the animator wants to illustrate as blowing in the wind. Three segments of the flag are to be transformed by the segment warp, labelled S1, S2, and S3 as shown. Match points MPI and MP2 are also shown at the lower corners of the flag. S1 is comprised of points 0-MP1, S2 of points MP1-MP2, and S3 of points MP2-3. A warp handle H is placed at point MP2 for convenience and potential warp path P, represented by the dotted line in Fig. 17(a), is drawn. Fig. I7{b) represents the profile graph for the three line segments. As shown in Fig. I7{b), segment S1 varies from zero displacement at the attach point 0 to I5 maximum displacement at MP1. Segment S2 is always at maximum displacement, and segment S3, like segment S1, varies from zero displacement at point 3 to maximum displacement.
Thus far, a normal segment warp has been described.
However, for wind effects, the warp path P represents only the potential warp path of the segments. The actual position along the path is determined by specifying a wind vector as shown in Fig. 17(c). This is sixrtply drawn by the animator. as if the wand were being blown back and forth by the wind, and recorded by the computer. Fox purposes of simplifying the description, the wind is shown blowing along the x-axis only. Fig. I7(d) represents the velocity profile for the wind which could be derived from tracking the rate of the back arid forth motion of the drawing wand when generating the wind path shown in Fig. 17(c). At maximum ' positive velocity the maximum positive displacement along the potential warp path is applied and at maximum negative velocity, the maximum negative displacement is applied. In addition, zero displacement is defined to occur at zero velocity. Displacements between zero and the maximum point and zero and the minimum point are produced simply SUBSTITUTE SHEET (RULE 26) by using the wind velocity at each frame interpolated so that the maximum wind velocity corresponds to maximum displacement.
a Depending on the direction (positive or negative) and speed of the wind, the segments will be warped as shown in Fig. 17(e) (negative} or 17{f) (positive). The displacement of a particular point of a line segment along the motion path at any given point in time is dictated by the velocity of the wind at that point in time, which could be positive or negative and thus also defines the direction of displacement. The potential warp path must be drawn with reference to the wind direction. Thus, if the wind direction 20 were not along only the x axis as shown in Fig. 17(a), but also along the z axis, a potential warp path would have to be drawn for how segments of the flag would be warped in the z axis. The wind velocity along the z axis would also be determined from the wind vector.
The advantage of this technique over a normal segment warp is that it provides for control of the displacement along a potential warp path as opposed to an actual predetermined warp path. In addition, use of the wind warp permits the same wind vector to be applied to numerous elements in a drawing which will all be similarly affected by the wind.
The animator may specify that the wind warp be applied to different objects in a drawing at different times to create the effect of a gust of wind moving through a scene.
Inertial effects are created in a manner similar to wind effects.
In this case, however, rather than using the wind velocity to control the displacement along a potential warp path, the acceleration of a main object of motion is used. For example, if a character begins to run, his acceleration will cause his coat to lift up behind him in the opposite direction. A potential warp path for the coat may be drawn, and the position of the appropriate segments of the coat along the potential warp path determined by the change in velocity (acceleration) of the person wearing the coat. Thus, when the character begins to move from a standing position, acceleration is greatest and the coat will fan out behind hirn to the maximum extent. As the character reaches a steady velocity, SUBSTITUTE SHEET (RULE 2&j however, his acceleration goes to zero and the coat returns to the zero displacement position.
Wave effects may also be created using the segment warp , concept. A "wave warp" is a means for creating the effect of a wave travelling through a segment or segments. In the case of a wave effect, a -warp handle and warp path are not required. A straight reference line A-B
as shown in Fig. 18(a) is drawn. The desired wave motion, shown as dotted line w1-w2, is drawn with reference to this line. The wave W1-W2 need not lie in one plane but may be three-dimensional so as to define, for example, a corkscrew.
The displacements between each point along the wave relative to the line A-B is calculated based on vectors drawn normal to the straight line and intersecting the wave. For each point Pi along the wave, the corresponding displacement Di is calculated. As shown in Fig. 18(b), these relative displacements are then applied to a line segment S of a drawing in order to transfer the effect of the wave to the object or objects in the drawing (only P1-P7, representing the first crest of the wave, are illustrated).
The result of the effect of the initial wave crest on the segment S in the first resulting frame is illustrated in Fig. 18(c). The points along the segment D1-D7 are displaced an amount D1-D7, respectively.
The series of displacements Dl-D7 defined by the wave of Fig. 18(a) is then shifted along the segment S (depending on the direction of travel of the wave) so that in the next frame of animation, the displacements are applied to different points along the segment S. In the example of Fig. 18, the wave is traveling to the right. As shown in Fig. 18(d), the displacements D1-D7 are shifted two points to the right so that they now are applied to points P3-P9 on the segment S. Thus, the segment in frame 2 appears as shown in Fig. 18(e). The amount of shift is determined by the velocity of travel for the wave, which is specified by the animator. The process is repeated for each successive frame of animation so as to create the appearance of a wave travelling through an object.
SUBSTITUTE SHEET (RULE 26) WO 97!24696 PCT/CA96/00881 As in the case of an ordinary segment warp, a warp profile graph is used to modulate the effect of the wave path at each point along
4 the segments affected segment or segments. For example, the warp profile graph may be drawn so that the wave effect may not be evident at all at the beginning of a segment but have an increasing effect as it travels along the segment. For example, the tail of a tadpole moving through the water would have no lateral wave movement at its root, but increasing movement toward the tail.
In one embodiment, the animator specifies four parameters to control the wave effect: i) the velocity of wave travel in terms of the number of points shifted per frame; ii) the direction of wave travel; iii) the starting point of the wave; and iv) the ending point of the wave. The wave path drawn by the animator is then interpolated based on these parameters to obtain the desired effect. For example, if the animator desires that the wave effect start and end on the segment so that it is present for the entire length of the animation, and that the velocity of wave travel is 1 point per frame, the length of the originally drawn wave path is adjusted by interpolation to be twice the length of the segment so that at the beginning of the animation, the entire first half of the wave is applied to the segment. Due to the movement of the wave through the segment during the animation, at the end of the animation, the first half has moved completely through the segment and the second half is entirely on the segment. Similarly, if the velocity is doubled, the wave path must be stretched by interpolation to four times the length. The wave effect may also be specified as starting or ending off of the segment, in which case the length would similarly be adjusted.
Wave warps are a very simple but powerful method for creating motion which appears organic and life-like.
Where the overall orientation of a character or object changes significantly during the course of an animation sequence (e.g., by more than 45° on any axis), simple segment warps may not create the desired effect. For example, in the segment warping of the tail shown in Fig. I2(b), SUBSTITUTE SHEET (RULE 26) if the fish were to turn over onto its side during the sequence, the- segment warps as shown would move the tail up and down relative to the fish rather than side to side. In this situation, a "constructed segment warp"
may be used.
For a constructed segment warp, a warp handle is indicated and a source warp path and source warp profile graph are drawn for each source pose of the character or object, with the source warp path appropriately related to the orientation of the object in that pose. Before the warp effect is applied, a constructed warp path and constructed warp profile graph are derived from the source warp paths and source warp profile graphs using weighted averaging in the same -manner as for the constructed poses. Similarly, from the velocity profiles of the source warp paths, a constructed velocity profile is derived fox the constructed warp path and may be modified as previously explained (the separate warp paths may need to be synchronized as described above so that they stay in sync regardless of the constructed pose). In this manner, the orientation of the constructed warp path is correctly related to the orientation of the object. The constructed warp path then produces the segment warp, as described above for simple segment warps.
For complex drawings using warps, it could be tedious if related warps were required for many segments. However, the concept may be readily extended to more complicated forms using a technique referred to as "spine warping." Spine warping is used to transform objects comprising multiple line segments with a single warp by applying the warp to a "spine" of the object. The term spine is used because a straight line is drawn roughly through the centerline of a group of line segments which may, for example, define the body of an animal. A warp is then applied to the spine and then transferred to the individual drawing segments. For spine warps, a straight line reference spine is drawn in each source pose used in a transformation and the animator selects the segments to be affected by the spine warp. For each segment selected, perpendicular distances from the points along the segment to the reference SUBSTITUTE SHEET (RULE 26) spine are calculated in order to transfer a warp applied to the spine to the selected segments. Constructed poses are generated in the manner previously described. The constructed poses include the straight line reference spine which is treated as an additional line in a source drawing
- 5 but not displayed. The spine warp is then applied to the appropriate segments of the constructed poses, using the displacements between the reference spine and the warped spine and the perpendicular distances from the points along the segments to the reference spine.
For example, Fig. 19(a) illustrates a constructed pose of a fish ~20 with a straight line spine, S. The spine is drawn by the animator but is not a part of the drawing that is displayed in the resulting animation frames.
The perpendicular distances from points Pl-Pn along the Line segments to the spine are calculated and stored in order to transfer warps imposed on the spine to the segments of the drawing. A single warp path P is used in 15 combination wifh a warp profile graph to warp the spine S. The spine may be warped by any of the above-described warps. Fig. 19(b) illustrates the warped spine S' (intended to be shown bending into the paper). For each line segment controlled by the spine warp, each point along~the segment is displaced using the calculated displacement of the warped spine relative to 20 the reference spine. In this manner, complex forms may be readily transformed in a simple manner using any of the above warping techniques.
A final aspect of the present invention also relates to creating constructed poses that maintain the proper coloring of source poses to 25 enable the completely automatic painting of a series of animation drawings. In prior art computer painting methods of painting images, closed loops are drawn in two-dimensional space and filled in with color using a "seed" point. This technique is well known in the art of two-dimensional computer drawing and painting systems. The seed point acts 30 as a starting point for the filling of closed Loops in the color chosen by the animator. Painting proceeds outward from the point until the boundary of the loop is detected and filling the bounded area.
SUBSTITUTE SHEET (RULE 26)
6 PCT/CA96i00881 _38_ However, the seed fill technique has drawbacks when used for the automatic painting of stereo and two-dimensional images. For example, when the seed fill method is used for small loops, it may be difficult or impossible for the animator to place the seed point within a stereo loop in such a position that when the fill method is applied to the left and right eye two-dimensional projections of the stereo image, the seed point falls within each projected two-dimensional projected loop.
The result is that for one or both eye projections, it may happen that the exterior of the loop is filled and not the interior. In addition, where a computer-assisted animation sequence of drawings is being generated and it is desired to automatically paint the series of drawings, the generated drawings may, by design, contain single loops that twist in -three-dimensional space, thus creating several apparent loops in the two-dimensional projections of the transformed loop. In this situation, the seed point may fall entirely out of the Ioops, or only fill one of the two-dimensional loops. For example, a single loop with a seed point SP, shown in Fig. 20(a), may be twisted into a figure 8 when it is projected onto a plane creating two loops on the plane, shown in Fig. 20(b). The seed point SP may then fail within only one of the loops of the figure 8 as shown in Fig. 20(8), in which case only that portion will be filled.
Alternatively, the seed point may fall outside the loop entirely, as sho~nm in Fig. 20(c), in which case the area external to the loop will be colored.
The present invention solves this problem using a technique referred to herein as "fill masking." Fill masking is a technique where a painted loop that is part of a stereo image is filled for display purposes by processing the loop prior to display in the following manner. First, the Left and right eve projections of the stereo image of the loop on to a two-dimensional plane are ascertained. For each of these projections, in an off-screen buffer, a rectangle at least one pixel larger on each side than the projected loop is generated by determining the minimum and maximum x and y coordinates of the Loop as shown in Fig. 5{a). Fig. 21(a) illustrates a single eye projection of a loop and rectangle. The entire rectangular area is SUBSTITUTE SHEET (RULE 26) generated in the color with which the loop is to be filled. The two-dimensional projection of the loop originally drawn by the animator is transferred to the buffer in the proper line color for the loop as shown in Fig. 22(b). A fill of the rectangle is then performed using the seed point and flood fill method discussed above. The seed point is generated just within any corner of the rectangle. For this fill, only the region bounded by the exterior of the loop and the rectangle is filled so that the interior of the loop is not filled and therefore remains in the original loop color as shown in Fig. 22(c). The fill consists of a code that makes this bounded region transparent when displayed so that only the loop remains visible in the proper color. After processing in this manner, which takes only a small fraction of a second, the rectangle is transferred from the buffer to the viewable display. It is known in the art of computer drawing systems to provide a "transparent" or "no-copy" color to indicate that the region filled with this color should not be copied to the screen from the buffer.
AlI that appears is the loop in the proper color and the boundary line for the loop. For stereo loops, the process is repeated for each of the left and right eye projections of the loop.
This technique has been described for three-dimensional drawings but is equally applicable to the automatic painting of sequences of two-dimensional drawings.
The appendix contains the BASIC code for implementing the transformation graphs, space path, segment warps, wind warp, inertia warp, and wave warp of the present invention. This code is one example of the code that may be utilized and should not be construed as limiting.
Those of ordinary skill in the art of will recognize that other code may be used. The invention has been described in greatest detail with respect to the particular embodiments and exemplary applications described above.
However, the invention is not limited by this embodiment and examples, but is limited only by the scope of the appended claims.
SUBSTITUTC SHEET (RULE 26) ~DDAIIdfR
DEFINT A-Z
' Type Definitions ***************************************************
TYPE WandReportType X AS INTEGER
Y AS INTEGER
Z AS INTEGER
XX AS INTEGER
YY AS INTEGER
ZZ AS INTEGER
END TYPE
TYPE t3DPoint X AS SINGLE
Y AS SINGLE
Z AS SINGLE
END TYPE
TYPE SpaceRefPt Locat AS t3DPoint Label AS STRING * 5 Visib AS INTEGER
END TYPE
TYPE LocType X AS INTEGER
Y AS INTEGER
Z AS INTEGER
END TYPE
TYPE SterType lx AS INTEGER
rx AS INTEGER
Y AS INTEGER
END TYPE
TYPE TScriptWayPt Locat AS t3DPoint Label AS STRING * 8 END TYPE
TYPE LineType Beg AS INTEGER
Fin AS INTEGER
TempFin AS INTEGER
FinalStart AS INTEGER
FinalEnd AS INTEGER
WchGrp AS INTEGER
WchObj AS INTEGER
LineCol AS INTEGER
Looped AS INTEGER
PaintCol AS INTEGER

Intermit AS INTEGER
KeyForm AS INTEGER
Threshold AS SINGLE
StartVis AS INTEGER
EndVis AS INTEGER
i,~el AS STRING * 8 NormOrMag AS SINGLE
END TYPE
TYPE TempSe9TYhe WchLine AS INTEGER
AStartPt AS INTEGER
AEndPt AS INTEGER
BStartPt AS INTEGER
BEndPt AS INTEGER
CStartPt AS INTEGER
CEndPt AS INTEGER
DStartPt AS INTEGER
DEndPt AS INTEGER
Wchobj AS INTEGER
WchGrp AS INTEGER
WchLngst AS INTEGER
ADist AS SINGLE
BDist AS SINGLE
CDist AS SINGLE
DDist AS SINGLE
END TYPE
TYPE FinlSgType WchLine AS INTEGER
Beg AS INTEGER
Fin AS INTEGER
Wchobj AS INTEGER
WchGrp AS INTEGER
WchInfoArr AS INTEGER
WarpNo AS INTEGER
Anchor AS INTEGER
END TYPE
TYPE WarpType Label AS STRING * 11 END TYPE
TYPE RefPtType Frame AS INTEGER
TempPtsIndex AS INTEGER
Label AS STRING * 15 Wchobj AS INTEGER
WchGrp AS INTEGER
WchWrp AS INTEGER
END TYPE
TYPE TransType PropA AS SINGLE
PropB AS SINGLE
PropC AS SINGLE
PropD AS SINGLE
END TYPE

TypE WarpProfileType Proportion AS SINGLE
END TYPE
TYPE GroupTyPe WchObj AS INTEGER
Label AS STRING * 6 Transshift AS INTEGER
VelHookl AS INTEGER
VelSlavl AS INTEGER
VelHook2 AS INTEGER
VelSlav2 AS INTEGER
HandleVelcroLocat AS t3DPoint END TYPE
TYPE Velcro'fype GrpWithHook AS INTEGER
HookPtIndex AS INTEGER
SlaveGrp AS INTEGER
HookXYZVals AS t3DPoint END TYPE
TYPE ZDistType Dist AS INTEGER
ObjNo AS INTEGER
END TYPE
TYPE ObjectType PathNo AS INTEGER
ZDist ~ I~'~ER
Label AS STRING * 6 HasAnchors AS INTEGER
StartVis AS INTEGER
EndVis AS INTEGER
FakeZShift AS INTEGER
END TYPE
TYPE ObjectFinalPositType FinalPositObjl AS t3DPoint FinalPositObj2 AS t3DPoint FinalPositObj3 AS t3DPoint END TYPE
TYPE SegWarpInfoType WchSeg AS INTEGER
Hndl AS INTEGER
ProfBeg AS INTEGER
Kind AS STRING * 4 WchPath AS INTEGER
WchWave AS INTEGER
WchProf AS INTEGER
SegLen AS INTEGER
WaveSpeed AS INTEGER
Direc AS STRING * 4 Overlap AS INTEGER
END TYPE
TYPE PaintType SeedA AS t3DPoint SeedB AS t3DPoint SeedC AS t3DPoint SeedD AS t3DPoint PaintCol AS INTEGER
wchLn AS INTEGER
END TYPE
TYPE RegType ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
TYPE TransferType (~md AS INTEGER
Param AS INTEGER
X AS SINGLE
Y AS SINGLE
Z AS SINGLE
END TYPE
TYPE AnchorRUnType WchObj AS INTEGER
WchGrp AS INTEGER
VachLine AS INTEGER
WchSeg AS TNTEGER
WchPt AS INTEGER
StartFrame AS INTEGER
EndFrame AS INTEGER
Label AS STRING * 8 END TYPE
'following are constants for Cmd field:
'commands that need XYZ:
CONST ePointAt = &H1000'4096 CONST eLineTo = &H2000 '8192 CONST eFloodFill = &H3000'12288 'commands that need nothing:

CONST eNop = 0 'commands that need Param:

CONST eStartCel = &HA00'2560 CONST eSetColor = &H100'256 CONST ePaletteSize = '2816 &HB00 CONST eSetMix = &H300 '768 CONST eSetLineWidth '1024 = &H400 CONST eAddBorderColor '1280 = &H500 CONST eDeleteBOrderColor'1536 = &H600 CONST eClearBorderColors = &H700 '1792 CONST eStartEntity = &HC00 '3072 ' bit masks for Param for eStartEntity CONST eFilled = &H1 CONST eNonFilled = 0 CONST eLooped = &H2 CONST eNonLooped = 0 General Enumerations ************************************************
CONST False = 0 CONST True = -1 CONST eScanTransOnTempGraph = 2 CONST eObjPathOnTempPts = 3 CONST eObjPathByFrms = 4 CONST eScanForWarpByFrms = 5 CONST eScanTransByFrms = 6 CONST eScanGrpTransPlusPath = 7 CONST eScanForObjPathSyncPt = 8 CONST eScanForTransSyncPt = 9 CONST eScanForWarpSyncPt = 10 CONST eScanForReferenceObject = 11 CONST eScanFOrAnchorPts = 12 CONST eObjPath = 13 CONST eTScript = 14 CONST eWarpPath = 15 CONST eWaveShape = 16 CONST eWindPath = 17 External Subroutine Declarations ************************************
' Initialize, Read and Close 3D Pointing Device DECLARE SUB InitWand DECLARE SUB ReadWand (SEG Location AS WandReportType) DECLARE SUB CloseWand ' Record Image on Screen for Local Playback DECLARE SUB Snapshot (BYVAL NameCOde, BYVAL FrameNo) ' EMS Memory Functions DECLARE SUB EMSInit (BYVAL PagesReq, SEG Result) DECLARE SUB PagesAvail (SEG Count, SEG Result) DECLARE SUB GetArray (BYVAL PageNo, BYVAL Index, SEG Value) DECLARE SUB SetArray (BYVAL PageNo, BYVAL Index, BYVAL Value) DECLARE SUB GetArrayReal (BYVAL PageNo, BYVAL Index, SEG Value AS SINGLE) DECLARE SUB SetArrayReal (BYVAL PageNo, BYVAL Index, BYVAL Value AS SINGLE) DECLARE SUB EMSCIose EMS memory page assignments *****************************************
' Normal EMS page allocations - change TWEENY.C if more than 80 needed CONST RawPtsXPg '*
= 0 CONST RawPtsYPg '*
= 1 CONST RawPtsZPg '*
= 2 CONST TempPtsXPg '*
= 3 CONST TempPtsYPg '*
= 4 CONST TempPtsZPg '*
= 5 CONST JAPtsXPg = '*

CONST JAPtsYPg = '*
7 CONST JAPtsZPg = ~*
8 CONST JBPtsXPg = '*
9 CONST JBPtsYPg = '*

CONST JBPtsZPg = '*

CONST JCPtsXPg = '*

CONST JCPtsYPg = '*

CONST JCPtsZPg = '*

CONST JDPtsXPg = '*

CONST JDPtsYPg = '*

CONST JDPtsZPg = '*

CONST TempPts2XPg = 18 CONST TempPts2YPg = 19 CONST TempPts2ZPg = 20 CONST PathlXPg = '*

CONST PathlYPg = '*

CONST PathlZPg = '*

CONST Path2XPg = '*

CONST Path2YPg = '*

CONST Path2ZPg = '*

CONST Path3XPg = '*

CONST Path3YPg = '*

CONST Path3ZPg = '*

CONST Path4XPg = '*

CONST Path4YPg = '*

CONST Path4ZPg = '*

CONST PathSXPg = '*

CONST PathSYPg = '*

CONST PathSZPg = '*

CONST Path6XPg = '*

CONST Path6YPg = '*

CONST Path6ZPg = '*

CONST Path7XPg = '*

CONST Path7YPg = '*

CONST Path72Pg = '*

CONST PathBXPg = '*

CONST PathBYPg = '*

CONST PathBZPg = '*

CONST WaveShapelXPg = 45 CONST WaveShapelYPg = 46 CONST WaveShapelZPg = 47 Interlaced buffer pages : change TWEENY.C if more than 32 needed CONST APtsXPg = 256 + 0 CONST APtsYPg = 256 + 1 CONST APtsZPg = 256 + 2 CONST BPtsXPg = 256 + 3 CONST BPtsYPg = 256 + 4 CONST BPtsZPg = 256 + 5 CONST CPtsXPg = 256 + 6 CONST CPtsYPg = 256 + 7 CONST CPtsZPg = 256 + 8 CONST DPtsXPg = 256 + 9 CONST DPtsYPg = 256 + 10 CONST DPtsZPg = 256 + 11 CONST FastWorkArraylXPg = 256 + 12 CONST FastWorkArraylYPg = 256 + 13 CONST FastWorkArraylZPg = 256 + 14 CONST FastWorkArray2XPg = 256 + 15 CONST FastWorkArray2YPg = 256 + 16 CONST FastWorkArray2ZPg = 256 + 17 CONST TempSmoothPtsXPg = 256 + 18 CONST TempSYnoothPtsYPg = 256 + 19 CONST TempSmoothPtsZPg = 256 + 20 CONST EMSPagesRequired = 82 * 8 '50 normal pages + 32 interlaced pages ' Global Data Variables ************************************************
DIM SHARED gBuildToggle DECLARE SUB ReCntrGrp (WchGrp$, PtArray~, CenterOfGrp() AS ANY) DECLARE SUB MrkGrpCntr (Message$, Pose , WchGrp~) DECLARE SUB ShowGrp (WchPose$, WchGrp$, ShowColor~) DECLARE FUNCTION DistBet2Pts! (aArrayl~, aArray2~, aPointIndexl$, aPointIndex2~) DECLARE SUB ShowFinalLn (WchPose~, LnNo~, ShowColor$) DECLARE SUB SwapLineDirection () DECLARE SUB ShowGuideMatchPts (WchPose~) DECLARE SUB MarkSpaceRefPts () DECLARE SUB ShowSpaceRefPts () DECLARE SUB AdjPathAlongXYZ (WchPath~) DECLARE SUB PathAdj () DECLARE SUB AdjObjPathStartEnd (Array$, NoOfArrayPts~) DECLARE SUB VisInvisObj () DECLARE SUB ChooseGrp (ChosenGrp~, GrpText$) DECLARE SUB ChooseObj (ChosenObj~, ObjText$) DECLARE SUB MrkVisInvisLine () DECLARE FUNCTION CalcDistBetPts! (Ptl AS ANY, Pt2 AS ANY) DECLARE FUNCTION FindAlnForInteztnit$ (WchPt~) DECLARE SUB MrkIntermtLine () DECLARE FUNCTION CalcTDist! (Vertex) DECLARE FUNCTION CalcTetFrms~ () DECLARE FUNCTION LnEndsClose (PtArray, IndexPtA, IndexPtB, Range) DECLARE FUNCTION FindAln (aMatchPt, aPointNdx) DECLARE FUNCTION CalcTProps (WchFrame) DECLARE FUNCTION XYZDiff () DECLARE FUNCTION WarpSegProfPtr! (WChProf, WhereInProf) DECLARE FUNCTION FindWchFinlSg (Array() AS ANY, PointNdx) DECLARE SUB PathShiftToMatchPrevRun (WchObj$) DECLARE SUB ShowAllFnlSegs (WchPose~) DECLARE SUB AllPosesAreA () DECLARE SUB ScanPoseTrans (ForWhat$, WchGrp~, WchObjPath$, FrameNo$) DECLARE SUB Velcro () DECLARE SUB TrnsfrPrevLnToTempPts (Array , Start , Finish , WchSource~, DestinationPose~) DECLARE SUB TrnsfrPrevLineToIm (WchSource~, DestinationPose$, WchLine$) DECLARE SUB ShowGrpTransInPathPosit (WchObj, WchGrp, Grp2, Index) DECLARE SUB ShowObjOnPath (WchObj, Obj2, ObjPathPosit AS t3DPOint) DECLARE SUB MrkObjAnchorPt () DECLARE SUB PlaceSyncPtsOnTempPath (Kind, WhichOne~, PathText$) DECLARE SUB ShowGroupTScript (WchGrp, Group2, ScanIndex, IndexType$) DECLARE SUB ChooseLineColor () DECLARE SUB ShowSyncPtLines (StartOfPresentSyncPts) DECLARE SUB SwapSortedSyncPts () DECLARE SUB FindFrmInChartObjGrpWarp (Kind, WchOne, WchFrame) DECLARE SUB ShowASegStart (WchSeg) DECLARE SUB WndPtScan (Object, Object2, Group, Group2, Array, Limit, Mark Type, ScanForWhat) DECLARE SUB DrawAPose () DECLARE SUB SetUpGlueLoops () DECLARE SUB DefnGrpsObjs () DECLARE SUB MkScaffold () DECLARE SUB DrawBCDPoses () DECLARE SUB FindLngstSeg () DECLARE SUB MtchPtsPartO () DECLARE SUB MkFrameScreenV4 (Kind$, WchOne~) DECLARE SUB MrkScaffoldPts () DECLARE SUB ShowScaffold (WchPose) DECLARE SUB MrkScaffoldCntr (Message$, WchObj, WchPOSe) DECLARE SUB VerticalText (Text$, y, x) DECLARE SUB NameWarps () DECLARE SUB SortSyncPtsFOrApplic (Kind, WchNo) DECLARE SUB PlaceSyncPtsOnFrmChrt (Kind, WchOne, Text) DECLARE SUB ScanFormTrans (ForWhat, WchGrp, WchObjPath, FrameNo) DECLARE SUB PaintLoop () DECLARE SUB D3Wave (RequiredLengthOfWave) DECLARE SUB TrnsfrWave (WaveNo) DECLARE SUB MyDelay (HOwLOng) DECLARE SUB WarpSegWaveShapePtr (PositionNo, WchWaveShape, WarpSegWaveShapePtPOSit AS ANY) DECLARE SUB ShowFnlSegs (WchArray, WchLine, ShowColor) DECLARE SUB MkPathC~cle () DECLARE SUB DefnPt (DefndPoint AS t3DPoint, Message, PtIsFor$, WchMrkr) DECLARE SUB PlaceFrmChrtS~ncPtsOnPath (Kind, WchNo) DECLARE SUB ColorIt () DECLARE SUB PutDnvMnuOnScrn (Text$, WchPose, Version) DECLARE SUB SmoothJoin (PtsToBeJoined, Range) DECLARE SUB TrnsfrATo (Array, ImageLns() AS ANY) DECLARE SUB NameObjects () DECLARE SUB NameGroups () DECLARE SUB SbtrcArr (Result, Whole, Part() AS ANY, I, J, K) DECLARE SUB ShowObjectSegs (WchObj, WchPose, aColor, aUseLines) DECLARE SUB MtchPtsPartl () DECLARE SUB FindInRng (PtArray, Start, Finish, Range) DECLARE SUB GetImFxXYZ (ImToFix, PtPosit) DECLARE SUB AdjMtchPt (WchPose, WchLine, MtchPtNdx) DECLARE SUB FindDesPt (WchPose, WchLine) DECLARE SUB MtchPtsPart2 (WchPose, MtchPtNdx) DECLARE SUB MtchPtsPart3 (WchPose, MtchPtNdx) DECLARE SUB JstfyTempSegsPartB (WChSeg, LngstSeg, SegStart, SegEnd) DECLARE SUB MkTetLns (Vertex, OtherVertex) DECLARE SUB SetupTetra () DECLARE SUB CalTetFrms () DECLARE SUB Tetra (WchGrp) DECLARE SUB DelLast (WchPose) DECLARE SUB DelLast.B (LnArray() AS ANY, WchPose) DECLARE SUB GetXYZ (WchPt) DECLARE SUB TrnsfrTmpToImPartB (PtArray) DECLARE SUB ShowGuideLnPart2 (LnArray() AS ANY, PtArray, WchPose) DECLARE SUB DelLastLnPart2 (LnArray() AS ANY, PtArray, WchPose) DECLARE SUB ShortC~tObjects () DECLARE SUB PutInObj (WchGrp, WchObj) DECLARE SUB PutInGrp (WchLine, WchGrp) DECLARE SUB ShortCutGroups () DECLARE SUB NoMtchPts () DECLARE SUB CalcFlatXY () DECLARE SUB ShowFlatCrsr () DECLARE SUB ClearMtchPts () DECLARE SUB HiLiFinlSg (SegNo) DECLARE SUB ShowGuideLn (WchPose) DECLARE SUB CalcMrkrPts () DECLARE SUB CalcLXRXY () DECLARE SUB TrnsfrWhlArray (Arrayl, Array2) DECLARE SUB WndMnu (Text$, A$, B$, C$, D$, E$) DECLARE SUB WndSlct (Ans$, Delay) DECLARE SUB WndChs (Text$, A$, B$, C$, D$, E$, Ans$, When) DECLARE SUB WndIn () DECLARE SUB Smooth (Arrayl, Array2, SmoothRange, E~renSpacing) DECLARE SUB ShowObjPath (Array, Visibility) DECLARE SUB MkPathGrfs (Spacer) DECLARE SUB Construct (BeginFrame, FinishFrame, NoOfObjectsForThisRun) DECLARE SUB GetSumWarpDisp (SegInfoLst(), SegInfoLstNdx, FrameNo, SegNo, SegPtNo, SumWazpDisp AS ANY) DECLARE SUB WarpSegPathArrayPositPtr (FrameNo, WchPath, WarpSegPathPtPosit AS ANY) DECLARE SUB PathArrayPositPtr (FrameNo, WchPath, ObjPathPOS AS ANY) DECLARE SUB TransPtr (FrameNo, WchGrp, AllProp AS TransType) DECLARE SUB Interpo (Array, StartOfGap, EndOfGap) DECLARE SUB Stretch (Small, Big, Start5~na11, EndSmall, StartBig, EndBig) DECLARE SUB ShowAllSegStarts () DECLARE SUB GetWarpProfile (WarpNo) DECLARE SUB FindMrkdPtInAPose (ThisOne, Text) DECLARE SUB MkUniPath (Text$, MkUniPathFor) DECLARE SUB FindInApts (FoundPt) DECLARE SUB JstfyTempSegsPartA () DECLARE SUB GetWndXYZ (Kind) DECLARE SUB MkSegs () DECLARE SUB DefnSegWarp (WrpNumber, AvlPth, AvlWarpProflArray) DECLARE SUB ShowFlatPt (x, y, C) DECLARE SUB TrnsfrProp (Array() AS ANY, NoOfVals~) DECLARE SUB TrnsfrWarp (Array() AS ANY, NoOfVals$) DECLARE SUB TrnsfrPath (aSourceArray, PathNo) DECLARE SUB ShowObj (WchObject, WchPOSe) DECLARE SUB DefnObjCntrs () DECLARE SUB ShowWhlImage (WchPose, ShowColor) DECLARE SUB ReCntrObj (WchObj, PtArray, CenterOfObj() AS t3DPoint) DECLARE SUB MrkObjCntr (Message$, WchPose, WchObj) DECLARE SUB HiLiLn (LnArray() AS ANY, PtArray, LnNo) DECLARE SUB IdentObjects () DECLARE SUB IdentGroups () DECLARE SUB GetPts (PtArray, PtArrayNdx) DECLARE SUB ErsMnu () DECLARE SUB GetStartFinish (LnLst() AS Line Type, LnNo, Start, Finish) DECLARE SUB TrnsfrTmpToImPartA (WchPose) DECLARE SUB ShowLn (WchPOSe, LnNo, ShowColor) DECLARE SUB L~T.nT,nArrayS (WchPose, Col) DECLARE SUB DrawABCDIm () DECLARE SUB EnterRawPt (PtIndex) DECLARE SUB LdLnLst (Array() AS LineType, WchPose, Col) DECLARE SUB Mrk (Kind, FlatStereo) DECLARE SUB ShowCrsr () DECLARE SUB DrawImg (WchPOSe) DECLARE SUB CrsrOn () DECLARE SUB MkMrkrs () DECLARE SUB OldSmooth (RuffPts() AS t3DPoint, SmoothPts() AS t3DPoint, SmoothRange) ' ************************************ General Utility Routines DECLARE FUNCTION Confirms (aQuestion$) DECLARE FUNCTION UserChoice~ (Text$, A$, B$, C$, D$, E$) DECLARE SUB WaitForClick () DECLARE FUNCTION Limits! (x!, L!, H!) DECLARE FUNCTION GetA~ (PageNo$, Index ) DECLARE FUNCTION GetAReal! (PageNo$, Index ) DECLARE SUB SetA (PageNo~, Index, Value) ' ************************************ Velocity Graph ROUtiries DECLARE SUB DoVelocityGraph (aDrawnPath, aFramePosArray, Text) DECLARE SUB DrawVelGraph (aDrawnPath, aFramePosArray) DECLARE SUB GetVelGraphFromPath (aDrawnPath) DECLARE SUB GetVelGraphFromUser (aDrawnPath) DECLARE SUB CalcFramePositions (aDrawnPath$, aFramePosArray$) DECLARE FUNCTION DistTONextPoint! (aArray~, aPointIndex~) ' ************************************ Interface with Sandde 6 DECLARE SUB WriteXFerInfo (C~, P~, x!, y!, Z!) ************************************ Low-level Drawing Routines DECLARE SUB Draw3DPoint (aPoint AS t3DPoint, aColor AS INTEGER) DECLARE SUB Draw3DLine (aPointl AS t3DPoint, aPoint2 AS t3DPoint, aColor AS INTEGER) DECLARE SUB DrawArray (aArray$, aColor$, aUseLines~) DECLARE SUB DrawPartialArray (aArray$, aStart$, aFinish~, aColor~, aUseLines~) COMMON SHARED LastLX, LastRX, LastY, LnNo, lastlmrkx, lastrmrkx, lastmrky COMMON SHARED FrstLn, GroupsDefnd, NoOfLines, NoOfGroups COMMON SHARED ObjectsDefnd, NoOfObjects, NoOfSortedS~ncPts, ImOK
COMMON SHARED NoOfFrames, Interval!, Operation, TransOK, WchGrp, MtchPtsOK
COMMON SHARED NoOfMtchPts, NoOfSegs, NoInSrs, TotalSegsLen, WarpNo, AvlInfArr COMMON SHARED TransGrfValsOK, A$, B$, C$, D$, E$, Ans$, UsesPrevPath, Delay COMMON SHARED FoundIt, ThisOne, Wx, Wy, Wz, OneFrameOnly, PtPosit, GrfValsOK
COMMON SHARED AllMtchPtsOK, OneSetChosen, WchLine, ObjectsNamed COMMON SHARED MkLineLoop$, LinesToDraw, LineColor, GroupsNamed, AdjustTestFrame COMMON SHARED WaveLen, WaveWarp, WaveNo, Xcenter, Ycenter, PathError COMMON SHARED Range, LeftBound, Topbound, RightBound, BottomBound, NoOfVelcros COMMON SHARED Magnified, S~mcPtIndex, WarpsNamedOK, NoOfWarps COMMON SHARED NoOfScaffoldPts, GlueLoopsYN, SegsOK, SumSegLen, RepeatA
COMMON SHARED FindLngstSegOK, JustifiedOK, WarpsOK, ObjCntrsOK, WaveSpeed COMMON SHARED DrawAPoseOK, DrawBPOSeOK, DrawCPoseOK, DrawDPoseOK, WchPoseForHili COMMON SHARED AvlPthOnEntryToWarp, ChoiceInSegHili, WchSeg, SaveThisRun COMMON SHARED ZPlane, Spacer, NoOfPathRefPts, ZFixed COMMON SHARED WchObj, FrameNo, NoOfColors, Scaffold, SaveName$, DoneMtchPts COMMON SHARED WaveRefStart AS t3DPoint, WaveRefEnd AS t3DPoint, AbortMatchPt COMMON SHARED DeleteAllButPreviouslmage, AllPosesSameAsA, NoOfAncRuns COMMON SHARED LinkingToPreviousRun, EndFrameOfPrevRun, RunName$, ColoredOK
COMMON SHARED PathMaster, Copycat, DuplicatePath, GlueLoops, Zoom!, ReUsingPoseAOnly COMMON SHARED WchPoseForMag, NormalIm, MagLinesToDraw, ReferenceFrame, UsingRefObject '$DYNAMIC
DIM SHARED SpaceRef(10) AS SpaceRefPt DIM SHARED FoundPt AS t3DPoint DIM SHARED InRegs AS RegType, OutRegs AS RegType DIM SHARED XYZ AS t3DPoint DIM SHARED LXRXY AS SterType, LastLXRXY AS SterType DIM SHARED MrkrPts AS SterType, LastMrkrPts AS SterType DIM SHARED LCrsr(9, 9) DIM SHARED RCrsr(9, 9) DIM SHARED CmrkL(9, 9) DIM SHARED CYnrkR ( 9 , 9 ) DIM SHARED SqmrkL(9, 9) DIM SHARED SqmrkR(9, 9) DIM SHARED TrmrkL(9, 9) DIM SHARED TrmrkR(9, 9) DIM SHARED CrossMrkL(9, 9) DIM SHARED CrossMrkR(9, 9) DIM SHARED TransferPt AS t3DPoint DIM SHARED LineLength(4, 75, 0) DIM SHARED ALnPlace(50, 1) DIM SHARED OtherLnPlace(50, 1) DIM SHARED PtsToBeJoined(30) DIM SHARED AncRun(10) AS AnchorRunType DIM SHARED XLeverage AS SINGLE
DIM SHARED YLeverage AS SINGLE
DIM SHARED ZLeverage AS SINGLE
DIM SHARED XAdjust AS SINGLE
DIM SHARED YAdjust AS SINGLE
DIM SHARED ZAdjust AS SINGLE
DIM MagCenter AS t3DPoint DIM ScreenCenter AS t3DPoint DIM MagDiff AS t3DPoint EMSInit EMSPagesRequired, Result IF Result <> 0 THEN
PRINT "Unable to allocate EMS memory, Error Code : ; HEX$(Result) STOP
ENDIF
StartAgain:
RESTORE
REDIM SHARED TPts(8) AS t3DPoint TPts(1).x = 105 TPts(2).x = 276 TPts(3).x = 455 TPts(4).x = 280 TPts(1).y = 341 TPts(2).y = 36 TPts(3).y = 338 TPts(4).y = 188 TPts(1).Z = -51 TPts(2).Z = -51 TPts(3).Z = -51 TPts(4).Z = 253 REDIM SHARED MBXVals(10) DATA 12, 98, 140, 226, 268, 354, 396, 482, 524, 610 'this is Wnd menu data FOR I = 1 TO 10 READ MBXVals(I) 'menuboxxvals LeftBound = 5: Topbound = 5: RightBound = 634: BottomBound = 344 NoOfColors = 1 CONST LCol = 4: CONST RCol = 9:
CONST ZDivisor = 18 MkMrkrs InitWand OUT 888, 128 + 16 + 8 + 4 + 2 'Provide power for various things ' 128 : Drawing switch ' 64 - used for oscilliscope debugging ' 32 - used for oscilliscope debugging ' 16 - used for IR transmitter power ' 8 - used for IR transmitter power ' 4 - used for IR transmitter power ' 2 - used for IR transmitter power ' 1 - Unused CrsrOn XLeverage = 10 YLeverage = 10 ZLeverage = 5 XAdjust = 150 YAdjust = 100 ZAdjust = -500 'minus moves cursor away from viewer KEY(1) ON
ON KEY(1) GOSUB ReduceXYZLeverage KEY(2) ON
ON KEY(2) GOSUB IncreaseXYZLeverage KEY(3) ON
ON KEY(3) GOSUB NormalXYZLeverage KEY(5) ON
ON KEY(5) GOSUB MagnifyDrawImg KEY(7) ON
ON KEY(7) GOSUB NormalDrawImg KEY(8) ON
ON KEY(8) GOSUB ZShiftNormal KEY(11) ON
ON KEY(11) GOSUB ShiftUp KEY(12) ON
ON KEY(12) GOSUB ShiftLeft KEY(13) ON
ON KEY(13) GOSUB ShiftRight KEY(14) ON

ON KEY(14) GOSUB ShiftDown KEy(30) ON

ON KEY(30) GOSUB ZCloser KEY(31) ON

ON KEY(31) GOSUB ZFarther KEY(1) ON

ON KEY(10) GOSUB ZShiftNormal ReUsingPoseAOnly =
False ReUsingPoses = False SavingPoses = False NormalIm = True DeleteAllButPreviousImage = True Operation = 0 DO

EnterLOOp:

SELECT CASE Operation SetArrayReal APtsXPg,0 0, SetArrayReal BPtsXPg,0 0, SetArrayReal CPtsXPg,0 0, SetArrayReal DPtsXPg,0 0, SetArrayReal RawPtsXPg,0, SetArrayReal TempPtsXPg,0, SetArrayReal APtsYPg, 0, 0 SetArrayReal BPtsYPg, 0, 0 SetArrayReal CPtsYPg, 0, 0 SetArrayReal DPtsYPg, 0, 0 SetArrayReal RawPtsYPg, 0, 0 SetArrayReal TempPtsYPg, 0, 0 SetArrayReal APtsZPg, 0, 0 SetArrayReal BPtsZPg, 0, 0 SetArrayReal CPtsZPg, 0, 0 SetArrayReal DPtsZPg, 0, 0 SetArrayReal RawPtsZPg, 0, 0 SetArrayReal TempPtsZPg, 0, 0 SetA APtsXPg, 0, 0 SetA BPtsXPg, 0, 0 SetA CPtsXPg, 0, 0 SetA DPtsXPg, 0, 0 REDIM SHARED ALns(75) AS LineType REDIM SHARED BLns(75) AS LineType REDIM SHARED CLns(75) AS LineType REDIM SHARED DLns(75) AS LineType REDIM SHARED Group(5) AS GroupType REDIM SHARED Object(3) AS ObjectType REDIM SHARED AObjCntr(3) AS t3DPoint REDIM SHARED AGrpCntr(5) AS t3DPoint REDIM SHARED MtchPts(50, 7) REDIM SHARED TempSegs(105) AS TempSegType REDIM SHARED ObjFinalPositions(5) AS ObjectFinalPositType DIM SHARED TransferInfo AS Transfer Type ON ERROR GOTO ErrorHandler NoFiles = False: SaveThisRun = False LinkingToPreviousRun = False NameOK = False UsingRecordedPoses = False ReUsingPreviousPoses = False SELECT CASE UserChoice("3D Or FLAT?", " , "3D", " , "Flat", "") ZFixed = False ZFixed = True END SELECT
CLS
IF Confirm("Link To Previous Run?") THEN
LinkingToPreviousRUn = True PrevLinkOK = False WHILE NOT PrevLinkOK
CLS
FILES "k:\Projects\Imax\Tweeny\Paul\*.tws"
PRINT "Listed Above Are The Records Of The LAST
(CONSTRUCTED) POSE Of Previous Runs"
IF NoFiles = True THEN
PRINT "No Files"
LinkingToPreviousRun = False ELSE
INPUT "Name Of Run To Be ADDED To (Do NOT Include .TWS
in Name)"; NameOfPreviousLink$
CLS
OPEN "k:\Projects\Imax\Tweeny\Paul\" + NameOfPreviousLink$
+ ".tws" FOR BINARY AS #1 GET #1, , NoOfPts SetA APtsXPg, 0, NoOfPts FOR I = 1 TO NoOfPts GET #1, , SXVal!: SetArrayReal APtsXPg, I, SXVal!
GET #1, , SYVal!: SetArrayReal APtsYPg, I, SYVal!
GET #1, , SZVal!: SetArrayReal APtsZPg, I, SZVal!
NEXT
DrawPartialArray APtsXPg, 1, GetA(APtsXPg, 0), -1, False PRINT "End Poses) Of "; NameOfPreviousLink$; '.
PrevLinkOK = False IF Confirm("End Poses) Of Correct Previous Link?") THEN
PrevLinkOK = True WHILE NOT NameOK
PRINT "Previous Link: '~ UCASE$(NameOfPreviousLink$) INPUT "Name For This Link (Same As Previous, But With Incremented Link No)"; RunName$
IF Confirm("Is " + UCASE$(RunName$) + " Correct Name For Link You Are About To Make?") THEN
NameOK = True PoseSave$ = RunName$
END IF

wEND
ELSE
CLOSE #1 SetArrayReal APtsXPg, 0, 0 SetA APtsXPg, 0, 0 END IF
END IF
WEND
IF LinkingToPreviousRun = True THEN
CLS
PRINT "Retrieving Constructed End Poses) Of , UCASE$(NameOfPreviousLink$) PRINT
PRINT "Match Points Of Previous Link Were Not Saved"

GET #1, , NoOfLines FOR I = 1 TO NoOfLines GET #1, , ALns(I) NEXT
ALns(0).Beg = NoOfLines GET #1, , NoOfGroups FOR I = 1 TO NoOfGroups GET #1, , Group(I) NEXT
GET #1, , NoOfObjects FOR I = 1 TO NoOfObjects GET #1, , Object(I) NEXT
FOR I = 1 TO NoOfObjects GET #1, , AObjCntr(I) NEXT
FOR I = 1 TO 5 GET #1, , ObjFinalPOSitions(I) NEXT
GET #1, , EndFrameOfPrevRun CLOSE #1 FOR I = 1 TO NoOfLines ALns(I).Intermit = False ALns(I).KeyForm = 0 ALns(I).Threshold = 0 NEXT
END IF
END IF
FOR I = 1 TO NoOfLines 'in case using prev poses IF ALns(I).Looped = 1 THEN GlueLoops = True NEXT
IF LinkingToPreviousRun = False THEN
SELECT CASE UserChoice("This Run For Experiment/Practise OR
To Keep?", " , "Expr/Prac", "TO Keep", " , "") RunName$ _ "Exprimnt"

WHILE NOT NameOK
INPUT "Name For This Run (8 characters including link no if any)"; RunName$
PrevFileTest$ _ "k:\Projects\Imax\Tweeny\Paul\" +
LEFT$(RunName$, 2) + °*.TWS"
FILES PrevFileTest$
IF NoFiles = True TF~N
NameOK = True ELSE
PRINT "Name Not Allowed; First Two Letters Duplicate Existing Files) Shown"
IF Confirm("Override?") THEN NameOK = True END IF
WIND
END SELECT
PoseSave$ = UCASE$(RunName$) IF Confirm("Use A Previously Recorded Set Of Source Poses?") THEN
CLS
FILES "k:\Projects\7max\Tweeny\Paul\*.POS"
PRINT "Listed Above Are The Previously Recorded Sets Of Poses"
INPUT "Use Which Set (Do Not Enter .POS)"; OldPoseRetrieve$
IF OldPoseRetrieve$ _ "ex" OR OldPoseRetrieve$ _ "Ex" TF~7 OldPoseRetrieve$ _ "Exprimnt"
UsingRecordedPoses = True ReUSingPreviousPoses = True ReUsingPoses = True ELSE
ReUsingPreviousPoses = False END IF
END IF
SaveThisRun = True CLS
Operation = 1 CASE 1 'run length IF LinkingToPreviousRun = False THEN CLS
IF ReUSingPoses = True THEN CLS
NoOfFramesOK = False WHILE NoOfFramesOK = False LOCATE 2, 1: INPUT "Length Of Run In Frames (Playback is at 24 fps)"; NoOfFrames Interval! = 570 / (NoOfFrames - 1) IF NoOfFrames > 0 THEN
LOCATE 3, 1: PRINT "Run Will Be"; NoOfFrames;
"Frames Long --Is That Correct?"
IF Confirm("") THEN NoOfFramesOK = True ELSE
PRINT "You Must Enter The No Of Frames Wanted": SLEEP 1 END IF
FOR I = 1 TO NoOfObjects Object(I).StartVis = 1 Object(I).EndVis = No0~Frames NEXT
CLS

IF UsingRecordedPoses = True Tf~N
Normallm = True IF ReUsingPreviousPoses = True Tf~1 GetPose$ = OldPoseRetrieve$
PRINT "Retrieving Source Poses Of "; UCASE$(GetPose$) PRINT
PRINT "Reminder: Match Points (If Any) Of These Source Poses Were Saved"

OPEN "k:\Projects\Imax\Tweeny\Paul\" + GetPOSe$ + ".POS"
FOR BINARY AS #3 GET #3, , NoOfAPts GET #3, , NoOfBPts GET #3, , NoOfCPts GET #3, , NoOfDPts SetA APtsXPg, 0, NoOfAPts SetA BPtsXPg, 0, NoOfBPts SetA CPtsXPg, 0, NoOfCPts SetA DPtsXPg, 0, NoOfDPts FOR I = 1 TO NoOfAPts GET #3, , SXVal!: SetArrayReal APtsXPg, I, SXVal!
GET #3, , SYVal!: SetArrayReal APtsYPg, I, SYVal!
GET #3, , SZVal!: SetArrayReal APtsZPg, I, SZVal!
NEXT
FOR I = 1 TO NoOfBPts GET #3, , SXVal!: SetArrayReal BPtsXPg, I, SXVal!
GET #3, , SYVal!: SetArrayReal BPtsYPg, I, SYVal!
GET #3, , SZVal!: SetArrayReal BPtsZPg, I, SZVal!
NEXT
FOR I = 1 TO NoOfCPts GET #3, , SXVal!: SetArrayReal CPtsXPg, I, SXVal!
GET #3, , SYVal!: SetArrayReal CPtsYPg, I, SYVal!
GET #3, , SZVal!: SetArrayReal CPtsZPg, I, SZVal!
NEXT
FOR I = 1 TO NoOfDPts GET #3, , SXVal!: SetArrayReal DPtsXPg, I, SXVal!
GET #3, , SYVal!: SetArrayReal DPtsYPg, I, SYVal!
GET #3, , SZVal!: SetArrayReal DPtsZPg, I, SZVal!
NEXT
GET NoOfLines #3, , FOR TO NoOfLines I
=

GET , ALns(I) #3, GET , BLns(I) #3, GET , CLns(I) #3, GET , DLns(I) #3, NEXT

ALns(0).Beg =
NoOfLines GET #3, , NoOfMtchPts FOR I = 1 TO NoOfMtchPts FOR J = 0 TO 7 GET #3, , MtchPts(I, J) NEXT
NEXT
GET #3, , NoOfGroups FOR I = 1 TO NoOfGroups GET #3, , Group(I) NEXT
GET #3, , NoOfObjects FOR I = 1 TO NoOfObjects GET #3, , Object(I) NEXT
CLOSE #3 FOR I = 1 TO NoOfLines 'in case using prev poses IF ALns(I).Looped = 1 THEN GlueLoops = True NEXT
DefnGrpsObjsOK = False GroupsDefnd = False: GroupsNamed = False: ObjectsDefnd = False ColoredOK = False ObjCntrsOK = False SegsOK = False Operation = 4 '(grps/objs) ELSE
Operation = 2 END IF
CASE 2 'glue loops yesno WHILE SetUpGlueLoopsOK = False SetUpGlueLoops SetUpGlueLoopsOK = True DrawAPoseOK = False WEND
Operation = 3 CASE 3 'drawAPose WHILE DrawAPoseOK = False IF LinkingToPreviousRun = False AND
UsingRecordedPoses = False THEN
DrawingImage = True SetA APtsXPg, 0, 0 SetA BPtsXPg, 0, 0 SetA CPtsXPg, 0, 0 SetA DPtsXPg, 0, 0 SetA RawPtsXPg, 0, 0 SetA TempPtsXPg, 0, 0 DeleteAllButPreviousImage = True Normal lm = True DrawAPose IF NOT NormalIm THEN GOSUB NormalDrawImg ELSE
FOR I = 1 TO NoOfLines DrawPartialArray APtsXPg, ALns(I).Beg, ALns(I).Fin, -1, True NEXT
END IF
DeleteAllButPreviousImage = True DrawAPoseOK = True MkScaffoldOK = False DrawBCDPosesOK = False DrawBPOSeOK = False DrawCPoseOK = False DrawDPOSeOK = False DefnGrpsObjsOK = False GroupsDefnd = False: GroupsNamed = False: ObjectsDefnd = False ColoredOK = False ObjCntrsOK = False SegsOK = False WEND
Operation = 4 CASE 4 'defn grps objs IF ReUsingPoses = True OR LinkingToPreviousRun = True THEN
IF Confirm("Redo Groups And Objects Assignments Made In Previous Source Poses Or Link?") THEN
DefnGrpsObjsOK = False: GroupsDefnd = False GroupsNamed = False: ObjectsDefnd = False ObjectsNamed = False NoOfGroups = 0: NoOfObjects = 0 ELSE
DefnGrpsObjsOK = True: GroupsDefnd = True GroupsNamed = True: ObjectsDefnd = True: ObjectsNamed = True END IF
ELSE
DefnGrpsObjsOK = False END IF
WHILE DefnGrpsObjsOK = False CLS
GroupsDefnd = False: GroupsNamed = False ObjectsDefnd = False: ObjectsNamed = False NoOfGroups = 0: NoOfObjects = 0 DefnGrpsObjs IF NoOfLines > 1 THEN
FOR I = 1 TO NoOfGroups CLS
FOR J = 1 TO NoOfLines IF ALns(J)_WChGrp = I THEN ShowLn 1, J, -1 NEXT
Text$ _ "These Lines Make Up Group " + Group(I).Label + "?"
DefnGxpsObjsOK = Confirm(Text$) NEXT
IF DefnGrpsObjsOK THEN
FOR I = 1 TO NoOfObjects CLS
FOR J = 1 TO NoOfLines IF ALns(J).WchObj = I THEN ShowLn 1, J, -1 NEXT
Text$ _ "These Lines Make Up Object " + Object(I).Label + "?"
DefnGrpsObjsOK = Confirm(Text$) NEXT
END IF
ELSE
DefnGrpsObjsOK = True END IF
WEND
IF ReUsingPoses = True THEN
IF Confirm("ReDraw B C D Source Poses Etren Tho Using Previous Source Poses? ") THEN
ReUsingPoses = False ReUsingPOSeAOnly = True DrawBCDPosesOK = False DrawBPoseOK = False DrawCPoseOK = False DrawDPoseOK = False ColoredOK = False ObjCntrsOK = False SegsOK = False SetArrayReal BPtsXPg, 0, 0 SetArrayReal CPtsXPg, 0, 0 SetArrayReal DPtsXPg, 0, 0 SetArrayReal RawPtsXPg, 0, 0 SetArrayReal Te~PtsXPg, 0, 0 SetA BPtsXPg, 0, 0 SetA CPtsXPg, 0, 0 SetA DPtsXPg, 0, 0 REDIM SHARED BLns(75) AS LineType REDIM SHARED CLns(75) AS LineType REDIM SHARED DLns(75) AS LineType END IF
END IF
IF ReUsingPoses = True THEN
Operation = 7 SegsOK = False FindLngstSegOK = False JustifiedOK = False AllMtchPtsOK = False ELSE
Operation = 5 END IF
CASE 5 'scaffold yesno WHILE MkScaffoldOK = False REDIM SHARED AScaffoldCntr(1) AS t3DPoint REDIM SHARED BScaffoldCntr(1) AS t3DPoint REDIM SHARED CScaffoldCntr(1) AS t3DPoint REDIM SHARED DScaffoldCntr(1) AS t3DPoint REDIM SHARED ScaffoldDisp(50) AS t3DPoint REDIM SHARED ImDrawingCentrDisp(4) AS t3DPoint MJcscaffold MkScaffoldOK = True WEND
Operation = 6 WHILE DrawBCDPosesOK = False Normallm = True DrawBCDPoses IF NOT Normallm THEN GOSUB NormalDrawImg DrawBCDPosesOK = True SegsOK = False FindLngstSegOK = False JustifiedOK = False AllMtchPtsOK = False WEND
IF Operation = 2 THEN

DrawAPoseOK = False AllPosesSameAsA = False SetUpGlueLoopsOK = False CLS
ELSE
Drawinglmage = False Operation = 7 END IF
CASE 7 'colorit plus mtchpts IF GlueLoops = True THEN
IF ReUsingPoses = True OR LinkingTOPreviousRun = True THEN
IF Confirm("Redo Painting?") THEN ColorIt ELSE
Colorlt END IF
END IF
Operation = 77 WHILE AllMtchPtsOK = False CLS
IF ReUsingPoses = True THEN
IF Confirm("ReDo Existing MatchPts (If Any)?") THEN
IF Confirm("Are You Sure You Want To Erase And ReDo Existing MatchPts?") THEN
REDIM SHARED MtchPts(50, 7) PrevMtchPtsErased = True CLS : MtchPtSPartl CLS
IF Confirm("All MtchPts OK?") THEnT AllMtchPtsOK = True END IF
ELSE
AllMtchPtsOK = True END IF
ELSE
IF PrevMtchPtsErased = True THEN LOCATE 2, 1:
PRINT "PREVIOUS MATCH PTS ERASED!"
IF Confirm("Make MtchPtS?") THEN
REDIM SHARED MtchPts(50, 7) CLS : MtchPtsPartl CLS
IF Confirm("All MtchPts OK?") THEN AIlMtchPtsOK = True ELSE
NoMtchPts AllMtchPtsOK = True END IF
END IF
WIND
IF NOT NormalIm THEN GOSUB NormalDrawlmg CLS
Operation = 777 PRINT "Saving Source Poses Of ", PoseSave$
OPEN "k:\Projects\Imax\Tweeny\Paul\" + PoseSave$ + ".POS" FOR

BINARY AS #3 EndOfAPts = GetA(APtsXPg, 0) EndOfBPts = GetA(BPtsXPg, 0) EndOfCPts = GetA(CPtsXPg, 0) EndOfDPts = GetA(DPtsXPg, 0) PUT #3, , EndOfAPts PUT #3, , EndOfBPts PUT #3, , EndOfCPts PUT #3, , EndOfDPts FOR I = 1 TO EndOfAPts XVal! = GetAReal!(APtsXPg, I) YVal! = GetAReal!(APtsYPg, I) ZVal! = GetAReal!(APtsZPg, I) PUT #3, , XVal!
PUT #3, , YVal!
PUT #3, , ZVal!
NEXT
FOR I = 1 TO EndOfBPts XVal! = GetAReal!(BPtsXPg, I) YVal! = GetAReal!(BPtsYPg, I) ZVal! = GetAReal!(BPtsZPg, I) PUT #3, , XVal!
PUT #3, , YVal!
PUT #3, , ZVal!
NEXT
FOR I = 1 TO EndOfCPts XVal! = GetAReal!(CPtsXPg, I) YVal! = GetAReal!(CPtsYPg, I) ZVal! = GetAReal!(CPtsZPg, I) PUT #3, , XVal!
PUT #3, , YVal!
PUT #3, , ZVal!
NEXT
FOR I = 1 TO EndOfDPts XVal! = GetAReal!(DPtsXPg, I) YVal! = GetAReal!(DPtsYPg, I) ZVal! = GetAReal!(DPtsZPg, I) PUT #3, , XVal!
PUT #3, , YVal!
PUT #3, , ZVal!
NEXT
PUT #3, , NoOfLines FOR I = 1 TO NoOfLines PUT #3, , ALns(I) PUT #3, , BLns(I) PUT #3, , CLns(I) PUT #3, , DLns(I) NEXT
PUT #3, , NoOfMtchPts FOR I = 1 TO NoOfMtchPts FOR J = 0 TO 7 PUT #3, , MtchPts(I, J) NEXT
PUT #3, , NoOfGroups FOR I = 1 TO NoOfGroups PUT #3, , Group(I) NEXT
PUT #3, , NoOfObjects FOR I = 1 TO NoOfObjects PUT #3, , Object(I) NEXT
CLOSE #3 CLS
LOCATE 4, 1: PRINT "The Source Poses You Have Drawn Have Been Saved, Under The Name ", PoseSave$
PRINT "Including Colors, Groups, Objects, and MatchPts"
PRINT
PRINT "YOU May Quit The Program If You Want To Do Only The Source Poses Now"
IF Confirm("Quit Now?") THEN
IF Confirm("Are You Sure You Want To Quit Now?") THEN END
END IF
CLS
Operation = 8 SegsOK = False WHILE SegsOK = False PRINT "Making Segs..."
MkSegs SegsOK = True FindLngstSegOK = False REDIM SHARED SegLen(4) REDIM SHARED LongestSeg(105, 1) FindLngstSeg REDIM SHARED FinlSgs(105) AS FinlSgType JstfyTempSegsPartA
TrnsfrWhlArray JAPtsXPg, APtsXPg TrnsfrWhlArray JBPtsXPg, BPtsXPg TrnsfrWhlArray JCPtsXPg, CPtsXPg TrnsfrWhlArray JDPtsXPg, DPtsXPg WarpsOK = False SegsOK = True Operation = 9 IF ReUsingPoses = True THEN
ObjCntrsOK = False ColoredOK = False InstTransCheck = False PosTransOK = False AnchorPtsAllOK = False WindOK = False AvlPath = 0 WarpsNamedOK = False NoOftVarps = 0 WarpsOK = False END IF

WHILE ObjCntrsOK = False REDIM SHARED BObjCntr(3) AS t3DPoint REDIM SHARED CObjCntr(3) AS t3DPoint REDIM SHARED DObjCntr(3) AS t3DPoint REDIM SHARED BGrpCntr(5) AS t3DPoint REDIM SHARED CGrpCntr(5) AS t3DPoint REDIM SHARED DGrpCntr(5) AS t3DPoint DIM SHARED MarkedObjCntr AS t3DPoint DIM SHARED MarkedGrpCntr AS t3DPoint DefnObjCntrs 'includes grp cntrs ObjCntrsOK = True PosTransOK = False InstTransCheck = False WEND
Operation = 10 IF Confirm("Redo Some Of Source Poses? ") THEN
SELECT CASE UserChoice("ReDo Which Pose", " , "B", "C", "D", "") CASE 2: DrawBPoseOK = False: REDIM SHARED BLns(75) AS
LineType: SetArrayReal BPtsXPg, 0, 0: SetA BPtsXPg, 0, 0 CASE 3: DrawCPoseOK = False: REDIM SHARED CLns(75) AS
LineType: SetArrayReal CPtsXPg, 0, 0: SetA CPtsXPg, 0, 0 CASE 4: DrawDPoseOK = False: REDIM SHARED DLns(75) AS
LineType: SetArrayReal DPtsXPg, 0, 0: SetA DPtsXPg, 0, 0 END SELECT
DrawBCDPosesOK = False Operation = 6 ELSE
Operation = 11 END IF

Operation = 12 IF NOT AllPosesSameAsA THEN
CLS
OneGroupExplored = False WHILE InstTransCheck = False REDIM SHARED TransGrfVal(0) AS TransType REDIM SHARED TEnds(4) AS SterType IF OneGroupExplored = False THEN Ques$ _ "Explore Actions Available For Groups) And Check For Line Reversals?"
ELSE Ques$ _ "Explore Other Groups And Check For Line Reversals?"
IF Confirm(Ques$) THEN
IF NoOfGroups > 1 THEN
WchGrp = UserChoice("Which Group?", Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, Group(5).Label) ELSE
WchGrp = 1 END IF
IF ZFixed = True THEN
PRINT "PUT ON THE RED BLUE GLASSES TO USE THE

TETRAHEDRON!"

ZFixedTempOff = True ZFixed = False END IF
ScanPoseTrans 0, WchGrp, 0, 0 OneGroupExplored = True ELSE
InstTransCheck = True END IF
REDIM SHARED TEnds(0) AS Ster'rype IF ZFixedTempOff = True THEN
PRINT "TAKE OFF THE RED BLUE GLASSES!"

ZFixedTempOff = False ZFixed = True END IF
CLS

WEND
END IF
IF OneGroupExplored = True THEN
IF Confirm("Redo Source Poses? ") THEN
Operation = 2 SetUpGlueLoopsOK = False DrawAPoseOK = False AllPosesSameAsA = False ELSE
IF Confirm("Sap Direction Of A Line?") THEN
SwapLineDirection AllMtchPtsOK = False InstTransCheck = False LOCATE 3, 1: PRINT "NOTE: You Will Have To Redo Any MatchPts You Have Made": SLEEP 2 Operation = 77 ELSE
Operation = 13 END IF
END IF
ELSE
Operation = 13 END IF

VelcrosOK = False REDIM SHARED VelcroAGrp(4) AS Velcro Type WHILE VelcrosOK = False IF NoOfGroups > 1 THEN
IF Confirm("Any Group Velcroed To Another Group?") THEN
Velcro IF Confirm("All Velcros OK?") THEN VelcrosOK = True ELSE
VelcrosOK = True END IF

ELSE
VelcrosOK = True END IF
WEND
Operation = 14 CASE 14 'does obj paths, and transform graphs for all groups of the object WHILE PosTransOK = False SyncPtIndex = 0 REDIM SHARED ObjectStatPos(3) AS t3DPoint REDIM SHARED PathRefPt(30) AS RefPtType REDIM SHARED syncpts(30) AS RefPtType REDIM SHARED SortedSyncPts(30) AS RefPtType REDIM SHARED TerminalPoint(1) AS t3DPoint REDIM SHARED FrmToFzmVelocity!(NoOfFrames) REDIM SHARED TEnds(4) AS SterType REDIM SHARED TransGrfVal(NoOfFrames) AS TransType DIM SHARED AllSumdPt AS t3DPoint DIM SHARED ObjPathPosit AS t3DPoint DIM SHARED AllProp AS TransType AvlPth = 0 SyncPtIndexAfterEachObjMoveAndTrans = SyncPtIndex FOR I = 1 TO NoOfObjects NoOfGroupsForThisObj = 0 FOR q = 1 TO NoOfGroups IF Group(q).WchObj = I THEN NoOfGroupsForThisObj =
NoOfGroupsForThisObj + 1 NEXT
ThisObjMoveAndGrpTransOK = False WHILE NOT ThisObjMoveAndGrpTransOK
SyncPtIndex = SyncPtlndexAfterEachObjMoveAndTrans SPIAfterEachObjMove = S~mcPtIndex IF I <> Copycat THEN
DO
PathError = False DO 'making obj path SyncPtIndex = SPIAfterEachObjMove CLS
IF NoOfObjects > 1 AND I > 1 THEN
Text$ _ "See A Frame Of Path+Action Of A Prev Obj As Ref For Dnvng Path Of " +
Object(I).Label + " ?"
IF Confirm(Text$) THEN
UsingRefObject = True IF NoOfObjects = 3 THEN
SELECT CASE UserChoice("Which Object?", Object(1).Label, Object(2).Label, " , " nn) CASE 1: RefObj = 1 CASE 2: RefObj = 2 END SELECT
ELSE
RefObj = 1 END IF
IF NoOfGroups > 1 THEN
RefGrpOK = False WHILE NOT RefGrpOK
SELECT CASE UserChoice("Which Group?", Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, Group(5).Label) CASE 1: RefGrp = 1 CASE 2: RefGrp = 2 CASE 3: RefGrp = 3 CASE 4: RefGrp = 4 CASE 5: RefGrp = 5 END SELECT
IF Group(RefGrp).WchObj <> RefObj THEN
BEEP: LOCATE 2, 1 PRINT Group(RefGrp).Label; " Does Not Belong To "; Object(RefObj).Label LOCATE 2, 1: PRINT SPACE$(70) ELSE
RefGrpOK = True END IF
WEND
ELSE
RefGrp = 1 END IF
WndPtScan RefObj, Obj2, RefGrp, Grp2, 0, NoOfFrames, MarkType, eScanGrpTransPlusPath END IF
END IF
WchObj = I
MarkSpaceRefPts WchObj = I
IF LinkingTOPreviousRun = True THEN
FOR P = 1 TO 5 SELECT CASE I
CASE 1: XYZ = ObjFinalPositions(P).
FinalPositObjl: Mrk 0, 1 CASE 2: XYZ = ObjFinalPositions(P).
FinalPositObj2: Mrk 0, 1 CASE 3: XYZ = ObjFinalPOSitions(P).
FinalPositObj3: Mrk 0, 1 END SELECT
SELECT CASE I
CASE 1: XYZ = ObjFinalPositions(1).
FinalPositObjl: Mrk 1, 1 CASE 2: XYZ = ObjFinalPositions(1).
FinalPositObj2: Mrk 1, 1 CASE 3: XYZ = ObjFinalPositions(1).
FinalPositObj3: Mrk 1, 1 END SELECT
NEXT
LOCATE 2, 1: BEEP
PRINT "This Is End Of Path For"; Object(i).Label;
"In Previous Run (Square Is End)"
PRINT "Start Of Next Path Will Automatically Be Matched To This": SLEEP 4 END IF
AvlPth = AvlPth + 1 Object(I).PathNo = AvlPth DO
CLS
IF UsingRefObject = True THEN
ShowGrpTransInPathPosit RefObj, RefGrp, 0, ReferenceFrame ShowS~aceRefPts MkUniPath Object(I).Label, eObjPath DrawArray TempPtsXPg, -1, True WndPtScan I, Obj2, 1, Grp2, TempPtsXPg, GetA(Te~PtsXPg, 0), 1, eObjPathOnT~Pts LOOP UNTIL Confirm("Path In Space OK?") IF LnEndsClose(TempPtsXPg, 1, GetA(TempPtsXPg, 0), 15) TF~N MkPathCycle IF LinkingToPreviousRun = True Tf~NN
PathShiftToMatchPrevRun I
CLS
DrawPartialArray TempPtsXPg, 1, GetA(TesnpPtsXPg, 0), -1, True SELECT CASE UserChoice("Put Sync Pts On Path In Space?", "", "On path", "On Fr Chrt", ~~ No ~~
CASE 2 'on path WchObj = I
ShowSpaceRefPts PlaceSyncPtsOnTempPath 1, I, "Mrk Velocity Control Reference Pts On Space Path Of "
+ Object(I).Label SortSyncPtsForApplic 1, I
SwapSortedSyncPts CASE 3 'on frm chrt ShowSyncPtLines SyncPtIndexAtStartOfObjMOVe PlaceSyncPtsOnFrmChrt 1, I, "Mrk Position/Timing Sync Pts For Space Path Of" +
Object(I).Label SortSyncPtsForApplic 1, I
SwapSortedSyncPts DrawArray TempPtsXPg, -1, False PlaceFrmChrtSyncPtsOnPath 1, I

SortSyncPtsForApplic 1, I
SortedSyncPts(1).Frame = 1 SortedSyncPts(1).TempPtsIndex = 1 SortedSyncPts(2).Frame = NoOfFrames 'this Mks last SortedSyncPts(syncpt) end of transform tetra graph SortedSyncPts(2).TempPtsIndex =
GetA(TempPtsXPg, 0) END SELECT
DO
CLS
DrawArray TempPtsXPg, -1, False Smooth TempPtsXPg, TempPts2XPg, 2, False Text$ _ "Graph Of Speed Of Movement Of " +
Object(I).Label + " Along Path In Space"
DoVelocityGraph TempPts2XPg, RawPtsXPg, Text$
IF PathError = True TIN EXIT DO
CLS
ShowSpaceRefPts WndPtScan I, Obj2, 0, Grp2, RawPtsXPg, 'TRANSFORM
GetA(RawPtsXPg, 0), 1, eObjPathByFrms LOOP UNTIL Confirm("Speed Of Movement Along Space Path OK?") IF PathError = True THEN EXIT DO
IF Confirm("Space Path Itself OK?") THEN
SPIAfterEachObjMove = SyncPtIndex EXIT DO
ELSE
AvlPath = AvlPath - 1 END IF
LOOP 'raking obj path LOOP WHILE PathError = True TrnsfrPath RawPtsXPg, AvlPth ELSE 'is a copycat object Object(I).PathNo = PathMaster END IF
SPIAfterEachTrans = SyncPtlndex FOR J = 1 TO NoOfGroups PathError = False ThisGrpTransOK = False Grp2 = 0 IF Group(J).WchObj = I THEN
DO
ControlGraphOutOfRange = False DO
SyncPtIndex = SPIAfterEachTrans IF J = 1 THEN REDIM SHARED Transl(NoOfFrames) AS
TransType IF J = 2 THEN REDIM SHARED Trans2(NoOfFrames) AS
TransType IF J = 3 THEN REDIM SHARED Trans3(NoOfFrames) AS
TransType IF J = 4 THEN REDIM SHARED Trans4(NoOfFrames) AS
TransType IF J = 5 THEN REDIM SHARED Trans5(NoOfFrames) AS
TransType CLS
IF AllPosesSameAsA THEN
AllPosesAreA
IF J = 1 THEN TrnsfrProp Transl(), NoOfFrames IF J = 2 THEN TrnsfrProp Trans2(), NoOfFrames IF J = 3 THEN TrnsfrProp Trans3(), NoOfFrames IF J = 4 THEN TrnsfrProp Trans4(), NoOfFrames IF J = 5 THEN TrnsfrProp TransS(), NoOfFrames ELSE
CLS
WchObj = I
wchGrp = J
Grp2 = 0 IF ZFixed = True THEN
PRINT "PUT ON THE RED BLUE GLASSES TO USE THE
TETRAHEDRON!"

ZFixedTempOff = True ZFixed = False END IF

DO
CLS
MkUniPath Group(J).Label, eTScript IF LnEndsClose(TempPtsXPg, 1, GetA(TempPtsXPg, 0), 15) THEN MkPathCycle CLS
DrawArray TempPtsXPg, -1, True WndPtScan I, Obj2, J, Grp2, TempPtsXPg, GetA(TempPtsXPg, 0), 1, eScanTransOnTempGraph LOOP UNTIL Confirm("Action Control Graph Looks OK?") DO
CLS
DrawArray TempPtsXPg, -1, True SyncPtIndex = SPIAfterEachTrans CLS
DrawPartialArray TempPtsXPg, 1, GetA(TempPtsXPg, 0), -1, True SELECT CASE UserChoice("Use Sync Pts On Action Control Graph?", " , "On Path", "On Fr Chrt", "No", "") CASE 2 'on path PlaceS~mcPtsOnTempPath 2, J, "Mark Timing/Transform Sync Pts For Transform Graph Of " +
Group(J).Label SortS~ncPtsFOrApplic 2, J
SwapSortedSyncPts CASE 3 'on frm chrt ShowSyncPtLines SyncPtIndexAtStartOfTrans PlaceSyncPtsOnFrmChrt 2, J, "Mark Timing/Transform Sync Pts For Transform Graph Of " +
Group(J).Label SortS~mcPtsForApplic 2, J
SwapSortedSyncPts DrawArray TempPtsXPg, -1, False PlaceFrmChrtS~mcPtsOnPath 2, J

SortSyncPtsForApplic 2, J
SortedSyncPts(1).Frame = 1 SortedSyncPts(1).TempPtsIndex = 1 SortedSyncPts(2).Frame = NoOfFrames 'this Mks last SortedSyncPts(syncpt) end of transform tetra graph SortedSyncPts(2).TempPtsIndex =
GetA(TempPtsXPg, 0) END SELECT
LOOP UNTIL Confirm("SyncPt Placement (Or Not Using SyncPts) OK?") IF ZFixedTempOff = True THEN
PRINT "TAKE OFF THE RED BLUE GLASSES!"

ZFixedTempOff = False ZFixed = True END IF
m Grp2 = 0 Text$ _ "Graph Of Speed Of Progression Of Action Of " + Group(WchGrp).Label DoVelocityGraph TeznpPtsXPg, RawPtsXPg, Text$
IF CalcTetFrms THEN
Done = True ELSE
CLS
PRINT "Your Control Graph has some points too far outside Tetrahedron - please redo"
BEEP
ControlGraphOutOfRange = True END IF
IF J = 1 THEN TrnsfrProp Transl(), NoOfFrames IF J = 2 THEN TrnsfrProp Trans2(), NoOfFrames IF J = 3 THEN TrnsfrProp Trans3(), NoOfFrames IF J = 4 THEN TrnsfrProp Trans4(), NoOfFrames IF J = 5 THEN TrnsfrProp Trans5(), NoOfFrames CLS
WndPtScan I, Obj2, J, Grp2, 0, NoOfFrames, Mark Type, eScanTransByFrms LOOP UNTIL Confirm("Speed Of Action Control OK?") END IF 'all poses are the same IF NoOfGroupsFOrThisObj > 1 AND J > 1 THEN
IF Confirm("Show Action Plus Path Plus Action Of A Reference Group?") THEN
DO
SelectionOK = False WHILE NOT SelectionOK
SELECT CASE UserChoice("", Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, "") CASE 1: Grp2 = 1 CASE 2: Grp2 = 2 CASE 3: Grp2 = 3 CASE 4: Grp2 = 4 END SELECT
IF Grp2 < J AND Group(Grp2).WchObj = I THEN
SelectionOK = True ELSE
LOCATE 2, 1 PRINT "Choice Unavailable":
SLEEP 2: CLS
SelectionOK = False END IF
WEND
WndPtScan I, Obj2, J, Grp2, 0, NoOfFrames, MarkType, eScanGrpTransPlusPath LOOP WHILE Confirm("Show With Another Reference Group?") END IF

ELSE
Grp2 = 0 WndPtScan I, Obj2, J, Grp2, 0, NoOfFrames, MarkType, eScanGrpTransPlusPath END IF
Text$ _ "Action Plus Path OK For " + Group(J).Label + ~~
LOOP UNTIL Confirm(Text$) IF ControlGraphOutOfRange = True THEN LOCATE 2, 1:
PRINT "Action Control Graph Was Out Of Range --You Must Redo It": SLEEP 2 LOOP WHILE ControlGraphOutOfRange = True SPIAfterEachTrans = SyncPtIndex END IF 'grp belongs to i object NEXT 'grp CLS
Text$ _ "Path, And Group Actions, For " + Object(I).Label + " All OK?"
IF Confirm(Text$) THEN
ThisObjMoveAndGrpTransOK = True SyncPtIndexAfterEachObjMoveAndTrans = SyncPtIndex ELSE
AvlPath = AvlPath - 1 END IF
WEND
NEXT 'object PosTransOK = True IF Confirm("Redo ALL Space Paths And Action Control Graphs?") THIN
IF Confirm("Are You Sure You Want To Redo ALL Space Paths And Action Control Graphs?") THIN
PosTransOK = False S~mcPtlndex = 0 ELSE
PosTransOK = True END IF
END IF
WEND
IF Confirm("Expand All Object Paths In Z?") THEN
INPUT "What Expansion Factor (2 to ?)"; ZExpansionMultiplier!
FOR K = 1 TO NoOfFrames SetArrayReal PathlZPg, K, GetAReal!(Pathl2Pg, K) - 650 SetArrayReal Path2ZPg, K, GetAReal!(Path2ZPg, K) - 650 SetArrayReal Path3ZPg, K, GetAReal!(Path3ZPg, K) - 650 SetArrayReal PathlZPg, K, GetAReal!(PathlZPg, K) ZExpansionMultiplier!
SetArrayReal Path2ZPg, K, GetAReal!(Path2ZPg, K) ZExpansionMultiplier!
SetArrayReal Path3ZPg, K, GetAReal!(Path3ZPg, K) ZExpansionMultiplier!
SetArrayReal PathlZPg, K, GetAReal!(PathlZPg, K) + 650 SetArrayReal Path2ZPg, K, GetAReal!(Path2ZPg, K) + 650 SetArrayReal Path3ZPg, K, GetAReal!(Path3ZPg, K) + 650 NEXT
END IF
Operation = 150 IF Confirm("Any Lines or Objects Intermittent?") SELECT CASE UserChoice("Which", " , "Line", "Object", "" "") SELECT CASE UserChoice("Method To Determine When Visible", "", "TScript", "FrameNo", "", "") 'CASE 2: MrkIntermtLine 'CASE 3: ErsMnu: MrkVisInvisLine END SELECT
MrkVisInvisLine VisInvisObj END SELECT
END IF
Operation = 15 IF Confirm("Use Anchor Pts?") THEN
WHILE AnchorPtsAllOK = False FinishedAllAnchors = False AncRunlndex = 0 WHILE FinishedAllAnchors = False INPUT "Name For Anchor Point"; Name$
MrkObjAnchorPt 'note that a velcro slave can't have anchor pt!!!
FoundSeg = FindWchFinlSg(FinlSgs(), ThisOne) WchObj = FinlSgs(FoundSeg).WchObj Object(WchObj).HasAnchors = 1 WchLine = FinlSgs(FoundSeg).WchLine WchGrp = ALns(WchLine).WchGrp WchSeg = FoundSeg WchPt = ThisOne CLS
FinishedRunsForThisPt = False WHILE FinishedRunsFOrThisPt = False IACATE 3, 1: PRINT "ANCHORED STRIPS SO FAR:"
LOCATE 4, 1 FOR I = 1 TO NoOfAncRuns PRINT AncRun(I).Label; AncRun(I).StartFrame;
AncRun(I).EndFrame NEXT
OrderCheckOK = False AncRunIndex = AncRunIndex + 1 LOCATE 18, 1: PRINT "THIS STRIP:"
LOCATE 19, 1 PRINT AncRUn(AncRunIndex).Label; "Strt";
AncRUn(AncRunIndex).StartFrame; " End";
AncRUn(AncRunIndex).EndFrame NoOfAncRuns = AncRunIndex AncRun(AncRunIndex).Label = Name$
AncRun(AncRunIndex).WchObj = WchObj AncRun(AncRunIndex).WchGrp = WchGrp AncRun(AncRunIndex).WchLine = WchLine AncRun(AncRunIndex).WchSeg = WchSeg AncRun(AncRunIndex).WchPt = WchPt AncRun(AncRunIndex).StartFrame = 0 LOCATE 1, 40: PRINT "Click On Anchor Start Frame"
WndPtScan WchObj, Obj2, WchGrp, Grp2, 0, NoOfFrames, 1, eScanForAnchorPts AncRun(AncRunIndex).StartFrame = ThisOne LOCATE 18, 1: PRINT "THIS STRIP:"
LOCATE 19, 1 PRINT AncRun(AncRunIndex).Label; "Strt";
AncRun(AncRunIndex).StartFrame; " End";
AncRun(AncRunIndex).EndFrame DO WHILE OrderCheckOK = False LOCATE 1, 30: PRINT "Click On Anchor End Frame "
WndPtScan WchObj, Obj2, WchGrp, Grp2, 0, NoOfFrames, 1, eScanForAnchorPts AncRun(AncRunIndex).EndFrame = ThisOne IF AncRun(AncRunIndex).EndFrame >_ AncRun(AncRunIndex).StartFrame THEN
OrderCheckOK = True LOCATE 18, 1: PRINT "THIS STRIP:"
LOCATE 19, 1 PRINT AncRun(AncRunIndex).Label; "Strt";
AncRun(AncRunIndex).StartFrame; " End";
AncRun(AncRunIndex).EndFrame ELSE
LOCATE 20, 1 PRINT "End Frame Can't Be Before Start Frame -Do Again"
BEEP: BEEP: BEEP

LOCATE 20, 1 PRINT SPACE$(40) OrderCheckOK = False END IF
LOOP
LOCATE 18, 1: PRINT "THIS STRIP:"
LOCATE 19, 1 PRINT AncRun(AncRunIndex).Label; "Strt";
AncRun(AncRunIndex).StartFrame; " End";
AncRun(AncRUnIndex).EndFrame Ques$ _ "More Anchored Sections For " +
AncRun(AncRunIndex).Label + "?"
ErsMnu IF NOT Confirm(Ques$) THEN FinishedRunsForThisPt = True ELSE FinishedRunsForThisPt = False WEND
IF NOT Confirm("Use Another Point As Sticky Point?") THEN
FinishedAllAnchors = True IF Confirm("Anchor Pts All OK") THEN
AnchorPtsAllOK = True ELSE
AnchorPtsAllOK = False CLS
END IF
WEND

END IF
Operation = 16 CASE 16 'Wind effect CLS
IF Confirm("Use Wind Effect?") THEN
WHILE WindOK = False AvlPth = AvlPth + 1 WindPath = AvlPth DO
MkUniPath "WindPath", eWindPath LOOP UNTIL Confirm("OK?") SortSyncPtsForApplic 1, I
SortedSyncPts(1).Frame = 1 SortedSyncPts(1).TempPtsIndex = 1 SortedSyncPts(2).Frame = NoOfFrames 'this Mks last SortedSyncPts(syncpt) end of transform tetra graph SortedSyncPts(2).TempPtsIndex = GetA(TempPtsXPg, 0) DO
CLS
DrawArray TempPtsXPg, -1, False Text$ _ "Velocity Graph For Wind Path"
DoVelocityGraph TempPtsXPg, RawPtsXPg, Text$
LOOP UNTIL Confirm("Wind Velocity Graph OK?") TrnsfrPath RawPtsXPg, AvlPth IF Confirm("Wind Effect OK?") THEN
WindOK = True ELSE
AvlPath = AvlPath - 1 END IF
WEND
END IF
Operation = 18 Operation = 18 CASE 18 'warps named IF Confirm("Use Segment Warps?") THEN
LOCATE 3, 1 PRINT "No Of Warps Available:", 7 - AvlPath: SLEEP 2 WHILE WarpsNamedOK = False REDIM SHARED Warp(10) AS Warp Type NameWazps WarpsNamedOK = True WarpsOK = False WEND
IF Confirm("No Of Warps And Names OK?") THEN
Operation = 19 ELSE
WarpsNamedOK = False Operation = 18 END IF
ELSE
Operation = 20 END IF
CASE 19 'warps IF NoOfWarps > 0 THEN
AvlPathAtStartOfWarps = AvlPath WHILE WarpsOK = False REDIM SHARED SegInfo(20) AS SegWarpInfoType REDIM SHARED WarpSrs(30, 1) AvlPath = AvlPathAtStartOfWarps AvlWarpProflArray = 0 CLS
FOR WarpIndex = 1 TO NoOfWarps GrfvalsOK = False DefnSegWarp WarpIndex, AvlPth, AvlWarpProflArray IF NOT NormalIm THEN GOSUB NormalDrawlmg IF UsesPrevPath = False AND WaveWarp = False THEN
'added if wavewarp false TrnsfrPath RawPtsXPg, AvlPth END IF
IF WaveWarp = True THEN
TrnsfrWave WaveNo END IF
DO
GetWarpProfile (WarpNo) LOOP UNTIL Confirm("Warp Profile OK?") J = AvlWarpProflArray 'next trnsfrs prop! along profile into a Profile array IF J = 1 THEN REDIM SHARED Profilel(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profilel(), TotalSegsLen IF J = 2 THEN REDIM SHARED Profile2(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile2(), TotalSegsLen IF J = 3 THEN REDIM SHARED Profile3(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile3(), TotalSegsLen IF J = 4 THEN REDIM SHARED Profile4(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile4(), TotalSegsLen IF J = 5 THEN REDIM SHARED Profile5(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile5(), TotalSegsLen IF J = 6 THEN REDIM SHARED Profile6(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile6(), TotalSegsLen IF J = 7 THEN REDIM SHARED Profile7(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile7(), TotalSegsLen IF J = 8 THEN REDIM SHARED Profile8(TOtalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile8(), TotalSegsLen IF J = 9 THEN REDIM SHARED Profile9(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profile9(), TotalSegsLen IF J = 10 THEN REDIM SHARED Profilel0(TotalSegsLen) AS
WarpProfileType: TrnsfrWarp Profilel0(), TotalSegsLen CLS
NEXT
IF Confirm("Warps OK?") THEN
WaxpsOK = True ELSE
WarpsOK = False END IF
WEND
END IF
Operation = 20 CASE 20 'end menu SELECT CASE UserChoice("", "Make Fans", " , " , " , "End Prgrm") ConstructOK = False Operation = 21 CloseWand END
END SELECT
CASE 21 'run WHILE ConstructOK = False DIM SHARED WarpSegDisp AS t3DPoint DIM SHARED SumWarpDisp AS t3DPoint Construct 1, NoOfFrames, NoOfObjects ConstructOK = True WEND
Operation = 20 'end menu END SELECT
KEY ( 7 ) ON
KEY(8) ON
LOOP
END
ErrorHandler:
SELECT CASE ERR
CASE 53: PRINT "No *.TWS Files Yet"
NoFiles = True END SELECT
RESUME NEXT
ShiftLeft:
XAdjust = XAdjust - 50 RETURN
ShiftRight:
XAdjust = XAdjust + 50 RETURN
ShiftUp:
YAdjust = YAdjust - 50 RETURN
ShiftDown:
YAdjust = YAdjust + 50 RETURN
ZFarther:
ZAdjust = ZAdjust - 100 LOCATE 2, 30: PRINT "Z Shift"; CINT(10000 / ZAdjust); SPACE$(5) RETURN
ZCloser:
ZAdjust = ZAdjust + 100 LOCATE 2, 30: PRINT "Z Shift"; CINT(10000 / ZAdjust); SPACE$(5) RETURN
ZShiftNormal:

_ 78 -ZAdjust = -500 LOCATE 2, 30: PRINT "Z Shift Normal "
RETURN
ReduceXYZLeverage:
XLeverage = XLeverage * 2 YLeverage = YLeverage * 2 ZLeverage = ZLeverage * 2 LOCATE 2, 30: PRINT "XYZ Lvrage"; CINT(100 / XLeverage); SPACE$(5) RETURN
IncreaseXYZLeverage:
XLeverage = XLeverage / 2 YLeverage = YLeverage / 2 ZLeverage = ZLeverage / 2 LOCATE 2, 30: PRINT "XYZ Lvrage"; CINT(100 / XLeverage); SPACE$(5) RETURN
NormalXYZLeverage:
XLeverage = 10 YLeverage = 10 ZLeverage = 5 LOCATE 2, 30: PRINT "XYZ Lvrage Normal "
RETURN
ReduceZLeverage:
ZLeverage = ZLeverage * 2 LOCATE 2, 30: PRINT "Z Lvrage"; CINT(100 / ZLeverage); SPACE$(5) RETURN
IncreaseZLeverage:
ZLeverage = ZLeverage / 2 LOCATE 2, 30: PRINT "Z Lvrage"; CINT(100 / ZLeverage); SPACE$(5) RETURN
NormalZLeverage:
ZLeverage = 5 LOCATE 2, 30: PRINT "Z Lvrage Normal "
RETURN
MdgrilfyDraWIIrig: '*******************
IF Normallm = True AND (Operation = 3 OR Operation = 6 OR Operation = 6 OR Operation = 19) THEN
DIM AStartRefPt AS t3DPoint DIM MagAStartRefPt AS t3DPoint SELECT CASE UserChoice("" " , "Expand", "Shift", "Reduce", "") CASE 2: PFac! = 3: MText$ _ "EXPANDED"
CASE 3: PFac! = 1: MText$ _ "SHIFTED"
CASE 4: PFac! _ .3: MText$ _ "REDUCED"
END SELECT
Text$ _ "Define Center Of Area To Be " + MText$
DefnPt MagCenter, Text, "Magnify", 1 ScreenCenter.x = 320 ScreenCenter.y = 175 ScreenCenter.Z = MagCenter.Z

_ 79 _ MagDiff.x = ScreenCenter.x - MagCenter.x MagDiff.y = ScreenCenter.y - MagCenter.y FOR I = 1 TO GetA(APtsXPg, 0) SetArrayReal APtsXPg, I, GetAReal!(APtsXPg, I) + MagDiff.x SetArrayReal APtsYPg, I, GetAReal!(APtsYPg, I) + MagDiff.y x! = ScreenCenter.x - GetAReal!(APtsXPg, I) y! = ScreenCenter.y - GetAReal!(APtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(APtsZPg, I) magx! = x! * PFac!
magy! = y! * PFac!
magz! = Z! * PFac!
SetArrayReal APtsXPg, I, ScreenCenter.x - magx!
SetArrayReal APtsYPg, I, ScreenCenter.y - magy!
SetArrayReal APtsZPg, I, ScreenCenter.Z - magz!
NEXT
FOR I = 1 TO GetA(BPtsXPg, 0) SetArrayReal BPtsXPg, I, GetAReal!(BPtsXPg, I) + MagDiff.x SetArrayReal BPtsYPg, I, GetAReal!(BPtsYPg, I) + MagDiff.y x! = ScreenCenter.x - GetAReal!(BPtsXPg, I) y! = ScreenCenter.y - GetAReal!(BPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(BPtsZPg, I) magx! = x! * PFac!
magy! = y! * PFac!
magz! = Z! * PFac!
SetArrayReal BPtsXPg, I, ScreenCenter.x - magx!
SetArrayReal BPtsYPg, I, ScreenCenter.y - magy!
SetArrayReal BPtsZPg, I, ScreenCenter.Z - magz!
NEXT
FOR I = 1 TO GetA(CPtsXPg, 0) SetArrayReal CPtsXPg, I, GetAReal!(CPtsXPg, I) + MagDiff.x SetArrayReal CPtsYPg, I, GetAReal!(CPtsYPg, I) + MagDiff.y x! = ScreenCenter.x - GetAReal!(CPtsXPg, I) y! = ScreenCenter.y - GetAReal!(CPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(CPtsZPg, I) magx! = x! * PFac!
magy! = y! * PFac!
magz! = Z! * PFac!
SetArrayReal CPtsXPg, I, ScreenCenter.x - magx!
SetArrayReal CPtsYPg, I, ScreenCenter.y - magy!
SetArrayReal CPtsZPg, I, ScreenCenter.Z - magz!
~f FOR I = 1 TO GetA(DPtsXPg, 0) SetArrayReal DPtsXPg, I, GetAReal!(DPtsXPg, I) + MagDiff.x SetArrayReal DPtsYPg, I, GetAReal!(DPtsYPg, I) + MagDiff.y x! = ScreenCenter.x - GetAReal!(DPtsXPg, I) y! = ScreenCenter.y - GetAReal!(DPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(DPtsZPg, I) magx! = x! * PFac!
magy! = y! * PFac!
magz! = Z! * PFac!
SetArrayReal DPtsXPg, I, ScreenCenter.x - magx!
SetArrayReal DPtsYPg, I, ScreenCenter.y - magy!
SetArrayReal DPtsZPg, I, ScreenCenter.Z - magz!
NEXT
CLS
IF Operation = 19 TI-IEN
FOR I = 1 TO GetA(TempPtsXPg, 0) SetArrayReal TempPtsXPg, I, GetAReal!(TempPtsXPg, I)+MagDiff.x SetArrayReal TempPtsYPg, I, GetAReal!(TempPtsYPg, I)+MagDiff.y x! = ScreenCenter.x - GetAReal!(TempPtsXPg, I) y! = ScreenCenter.y - GetAReal!(Tec~PtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(TempPtsZPg, I) magx! = x! * PFac!
magy! = y! * PFac!
magi! = Z! * PFac!
SetArrayReal TempPtsXPg, I, ScreenCenter.x - magx!
SetArrayReal TempPtsYPg, I, ScreenCenter.y - magy!
SetArrayReal TempPtsZPg, I, ScreenCenter.Z - magz!
NEXT
DrawArray TempPtsXPg, -1, True END IF
SELECT CASE WchPoseForMag CASE 1: ShowWhllmage l, -1 CASE 2: ShowWhllmage 2, -1 CASE 3: ShowWhllmage 3, -1 CASE 4: ShowWhllmage 4, -1 END SELECT
IF Drawinglmage = True THEN
IF LnNo = MagLinesToDraw THEN
PutDrwMnuOnScrn Text, WchPoseForMag, 1 ELSE
PutDrwMnuOnScrn Text, WchPoseForMag, 0 END IF
END IF
FOR s = 1 TO 2 SOUND 1000, 2 SOUND 2000, 2 NEXT
LOCATE 2, 30: PRINT "Image " + MText$
NormalIm = False END IF
KEI'(5) ON
RETURN
NormalDrawImg:
IF NOT NormalIm THEN
CLS
FOR I = 1 TO GetA(APtsXPg, 0) x! = ScreenCenter.x - GetAReal!(APtsXPg, I) y! = ScreenCenter.y - GetAReal!(APtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(APtsZPg, I) normx! = x! / PFac!
normy! = y! / PFac!
normz! = Z! / PFac!
SetArrayReal APtsXPg, I, ScreenCenter.x - norznx!
SetArrayReal APtsYPg, I, ScreenCenter.y - normy!
SetArrayReal APtsZPg, I, ScreenCenter.Z - normz!
SetArrayReal APtsXPg, I, GetAReal!(APtsXPg, I) - MagDiff.x SetArrayReal APtsYPg, I, GetAReal!(APtsYPg, I) - MagDiff.y NEXT
FOR I = 1 TO GetA(BPtsXPg, 0) x! = ScreenCenter.x - GetAReal!(BPtsXPg, I) y! = ScreenCenter.y - GetAReal!(BPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(BPtsZPg, I) normx! = x! / PFac!
normy! = y! / PFac!
normz! = Z! / PFac!

SetArrayReal BPtsXPg, I, ScreenCenter.x - normx!
SetArrayReal BPtsYPg, I, ScreenCenter.y - normy!
SetArrayReal BPtsZPg, I, ScreenCenter.Z - normz!
SetArrayReal BPtsXPg, I, GetAReal!(BPtsXPg, I) - MagDiff.x SetArrayReal BPtsYPg, I, GetAReal!(BPtsYPg, I) - MagDiff.y FOR I = 1 TO GetA(CPtsXPg, 0) x! = ScreenCenter.x - GetAReal!(CPtsXPg, I) y! = ScreenCenter.y - GetAReal!(CPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(CPtsZPg, I) normx! = x! / PFac!
normy! = y! / PFac!
normz! = Z! / PFac!
SetArrayReal CPtsXPg, I, ScreenCenter.x - norrnx!
SetArrayReal CPtsYPg, I, ScreenCenter.y - normy!
SetArrayReal CPtsZPg, I, ScreenCenter.Z - normz!
SetArrayReal CPtsXPg, I, GetAReal!(CPtsXPg, I) - MagDiff.x SetArrayReal CPtsYPg, I, GetAReal!(CPtsYPg, I) - MagDiff.y NEXT
FOR I = 1 TO GetA(DPtsXPg, 0) x! = ScreenCenter.x - GetAReal!(DPtsXPg, I) y! = ScreenCenter.y - GetAReal!(DPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(DPtsZPg, I) normx! = x! / PFac!
normy! = y! / PFac!
normz! = Z! / PFac!
SetArrayReal DPtsXPg, I, ScreenCenter.x - normx!
SetArrayReal DPtsYPg, I, ScreenCenter.y - normy!
SetArrayReal DPtsZPg, I, ScreenCenter.Z - normz!
SetArrayReal DPtsXPg, I, GetAReal!(DPtsXPg, I) - MagDiff.x SetArrayReal DPtsYPg, I, GetAReal!(DPtsYPg, I) - MagDiff.y CLS
IF Operation = 19 Tf~1 FOR I = 1 TO GetA(TempPtsXPg, 0) x! = ScreenCenter.x - GetAReal!(TempPtsXPg, I) y! = ScreenCenter.y - GetAReal!(TempPtsYPg, I) Z! = ScreenCenter.Z - GetAReal!(TempPtsZPg, I) normx! = x! / PFac!
normy! = y! / PFac!
normz! = Z! / PFac!
SetArrayReal TempPtsXPg, I, ScreenCenter.x - normx!
SetArrayReal TempPtsYPg, I, ScreenCenter.y - normy!
SetArrayReal TempPtsZPg, I, ScreenCenter.Z - normz!
SetArrayReal TempPtsXPg, I, GetAReal!(TempPtsXPg, I) - MagDiff.x SetArrayReal TempPtsYPg, I, GetAReal!(TempPtsYPg, I) - MagDiff.y NEXT
DrawArray TempPtsXPg, -1, True END IF
SELECT CASE WchPoseForMag CASE 1: ShowWhllmage 1, -1 CASE 2: ShowWhllmage 2, -1 CASE 3: ShowvJhllmage 3, -1 CASE 4: ShowWhllmage 4, -1 END SELECT
IF Drawinglmage = True TIN
IF LnNo = MagLinesToDraw TF~N
PutDrwMnuOnScrn Text, WchPoseFOrMag, 1 ELSE

PutDrwMnuOnScrn Text, WchPoseForMag, 0 END IF
END IF
NormalIm = True FOR s = 1 TO 2 SOUND 1000, 2 SOUND 2000, 2 NEXT
LOCATE 2, 30: PRINT "Image NORMAL"
END IF
KEY(7) ON
RETURN
REM $STATIC
SUB AdjMtchPt (WchPose, WchLine, MtchPtNdx) ErsMnu ImToFix = WchPose NdxToFix = MtchPtNdx SELECT CASE WchPose Start = 1: Finish = GetA(APtsXPg, 0) GetStartFinish BLns(), WchLine, Start, Finish GetStartFinish CLns(), WchLine, Start, Finish GetStartFinish DLns(), WchLine, Start, Finish END SELECT
PtMove = 6 LOCATE 8, 1: PRINT "Fast"
PtPOSit = MtchPts(NdxToFix, ImToFix) 'this lets you choose done right away if posit is ok LOCATE 10, 1: PRINT "Original"; PtPosit DO
A$ _ "Fast": B$ _ "Back": C$ _ "For<,vard": D$ _ "Done": E$ _ "Slow"
WndChs " , A$, B$, C$, D$, E$, Ans$, 0 IF Ans$ = D$ TF~N
MtchPts(NdxToFix, ImToFix) = PtPosit ErsMnu EXIT DO
ELSE
GetImFxXYZ ImToFix, PtPosit Mrk 0, 1 SELECT CASE Ans$
CASE A$
PtMove = 6 LOCATE 8, 1: PRINT "Fast"
CASE E$
PtMove = 1 LOCATE 8, 1: PRINT "Slow"
CASE C$
PtPosit = PtPosit + PtMove IF PtPosit > Finish TII~NN PtPosit = PtPosit - PtMove CASE B$
PtPOSit = PtPosit - PtMove IF PtPOSit < Start TF~N PtPosit = PtPOSit + PtMove END SELECT
GetImFxXYZ ImToFix, PtPosit Mrk 0, 1 LOCATE 11, 1: PRINT "Now"; PtPosit END IF
LOOP
C$ _ "Finished": D$ _ "Adj": WndChs " , "x", "x", C$, D$, "x", Ans$, 1 END SUB
SUB AdjObjPathStartEnd (Array, NoOfArrayPts) REDIM TerminalPositDiff(1) AS t3DPoint TerminalPositDiff(0).x = TexminalPoint(0).x - GetAReal!(Array, 1) TerminalPositDiff(0).y = TerminalPoint(0).y - GetAReal!(Array + 1, 1) TerminalPositDiff(0).Z = TerminalPoint(0).Z - GetAReal!(Array + 2, 1) TerminalPositDiff(1).x = TerminalPoint(1).x -GetAReal!(Array, (GetA(Array, 0))) TerminalPositDiff(1).y = TerminalPoint(1).y -GetAReal!(Array + 1, (GetA(Array, 0))) TerminalPositDiff(1).Z = TerminalPOint(1).Z -GetAReal!(Array + 2, (GetA(Array, 0))) Zoop = -1 Glob = NoOfArrayPts + 1 FOR K = 1 TO NoOfArrayPts Zoop = Zoop + 1 Glob = Glob - 1 XChange! _ (TerminalPositDiff(0).x * (NoOfArrayPts - Zoop) /
GetA(TempPtsXPg, 0)) + (TerminalPositDiff(1).x (NoOfArrayPts - Glob) /-GetA(TempPtsXPg, 0)) YChange! _ (Termi.nalPositDiff(0).y * (NoOfArrayPts - Zoop) /
GetA(TempPtsXPg, 0)) + (TerminalPositDiff(1).y (NoOfArrayPts - Glob) / GetA(TempPtsXPg, 0)) ZChange! _ (TerminalPositDiff(0).Z * (NoOfArrayPts - Zoop) /
GetA(TempPtsXPg, 0)) + (TerminalPositDiff(1).Z
(NoOfArrayPts - Glob) / GetA(TempPtsXPg, 0)) SetArrayReal Array, K, GetAReal!(Array, K) + XChange!
SetArrayReal Array + 1, K, GetAReal!(Array + 1, K) + YChange!
SetArrayReal Array + 2, K, GetAReal!(Array + 2, K) + ZChange!
NEXT
DrawPartialArray Array, 1, GetA(Array, 0), -1, True TerminalsMarked = False END SUB
SUB AdjPathAlongXYZ (WchPath) DIM PathStartPt AS t3DPoint DIM PathEndPt AS t3DPoint DO
shift = 0 B$ _ ..X.. : C$ _ ~~1.~~ : D$ _ ..Z.. : E$ _ ~~~it~~
WndChs "On Which Axis?", "x", B$, C$, D$, E$, Ans$, 0 Axis$ = Ans$
SELECT CASE Ans$
CASE "X"
B$ _ "Left": C$ _ "Right"
CASE "Y"
B$ _ "Up" : C$ _ "Doyai,~
CASE "Z"
B$ _ "Farther": C$ _ "Closer"

CASE E$
EXIT DO
END SELECT
DD
D$ _ "Done " + Axis$
WndChs "Which Direction?", "x", B$, C$, D$, "x", Ans$, 0 SELECT CASE Ans$
CASE B$
shift = shift - 4 CASE C$
shift = shift + 4 CASE D$
EXIT DO
END SELECT
LOCATE 5, 1: PRINT "shifting path "; WchPath; Ans$; " , shift LOOP
SELECT CASE WchPath PathStartPt.x = GetAReal(PathlXPg, 1) PathStartPt.y = GetAReal(PathlYPg, 1) PathStartPt.Z = GetAReal(PathlZPg, 1) PathEndPt.x = GetAReal(PathlXPg, GetA(PathlXPg, 0)) PathEndPt.y = GetAReal(PathlYPg, GetA(PathlXPg, 0)) PathEndPt.Z = GetAReal(PathlZPg, GetA(PathlXPg, 0)) PathStartPt.x = GetAReal(Path2XPg, 1) PathStartPt.y = GetAReal(Path2YPg, 1) PathStartPt.Z = GetAReal(Path2ZPg, 1) PathEndPt.x = GetAReal(Path2XPg, GetA(Path2XPg, 0)) PathEndPt.y = GetAReal(Path2YPg, GetA(Path2XPg, 0)) PathEndPt.Z = GetAReal(Path2ZPg, GetA(Path2XPg, 0)) PathStartPt.x = GetAReal(Path3XPg, 1) PathStartPt.y = GetAReal(Path3YPg, 1) PathStartPt.Z = GetAReal(Path3ZPg, 1) PathEndPt.x = GetAReal(Path3XPg, GetA(Path3XPg, 0)) PathEndPt.y = GetAReal(Path3YPg, GetA(Path3XPg, 0)) PathEndPt.Z = GetAReal(Path3ZPg, GetA(Path3XPg, 0)) END SELECT
TerminalPoint(0) = PathStartPt TerminalPoint(1) = PathEndPt SELECT CASE Axis$
CASE "X"
TerminalPoint(0).x = PathStartPt.x + shift TerminalPoint(1).x = PathEndPt.x + shift CASE "y..
TerminalPoint(0).y = PathStartPt.y + shift TerrninalPoint(1).y = PathEndPt.y + shift CASE "Z°
TerminalPoint(0).Z = PathStartPt.Z + shift TerminalPoint(1).Z = PathEndPt.Z + shift END SELECT
TerminalsMrked = True SELECT CASE WchPath AdjObjPathStartEnd PathlXPg, GetA(PathlXPg, 0) ShowObjPath PathlXPg, 1 AdjObjPathStartEnd Path2XPg, GetA(Path2XPg, 0) ShowObjPath Path2XPg, 1 AdjObjPathStartEnd Path3XPg, GetA(Path3XPg, 0) ShowObjPath Path3XPg, 1 END SELECT

LOOP
END SUB
SUB AllPosesAreA
FOR I = 1 TO NoOfFrames TransGrfVal(I).PropA = 1 TransGrfVal(I).PropB = 0 TransGrfVal(I).PropC = 0 TransGrfVal(I).PropD = 0 NEXT
END SUB
FUNCTION CalcDistBetPts! (Ptl AS TScriptWayPt, Pt2 AS TScriptWayPt) x! _ (Ptl.Locat.x - Pt2.Locat.x) y! _ (Ptl.Locat.y - Pt2.Locat.y) Z! _ (Ptl.Locat.Z - Pt2.Locat.Z) CalcDistBetPts! = SQR(x! * x! + y! * y! + Z! * Z!) END FUNCTION
SUB CalcFlatXY
LXRXY.lx = XYZ.x - 1 LXRXY.rx = XYZ.x LXRXY.y = XYZ.y IF LXRXY.lx < LeftBound THEN LXRXY.lx = LeftBound IF LXRXY.rx < LeftBound THEN LXRXY.rx = LeftBound IF LXRXY.lx > RightBound THEN LXRXY.lx = RightBound IF LXRXY.rx > RightBound THEN LXRXY.rx = RightBound IF LXRXY.y < Topbound THEN LXRXY.y = Topbound IF LXRXY.y > BottomBound THEN LXRXY.y = BottomBound END SUB
SUB CalcFramePositions (aDrawnPath, aFramePosArray) SetA aFramePosArray, 0, NoOfFrames ReqdDist! = 0 FOR Frame = 1 TO NoOfFrames CurrDist! = 0 ReqdDist! = ReqdDist! + FzmToFrmVelocity!(Frame) PtNo = 1 NextDist! = DistToNextPOint!(aDrawnPath, PtNO) DO WHILE CurrDist! + NextDist! < ReqdDist!
PtNo = PtNO + 1 IF PtNo > 20000 THEN
PathError = True LOCATE 2, 1: PRINT "Path Error --Redo Path": SLEEP 2 EXIT DO
END IF
CurrDist! = CurrDist! + NextDist!
NextDist! = DistToNextPOint!(aDrawnPath, PtNo) LOOP
IF PathError = True THEN GOTO GetOut PctNeeded! _ (ReqdDist! - CurrDist!) / NextDist!
SetArrayReal aFramePosArray + 0, Frame, GetAReal!(aDrawnPath + O,PtNo) * (1 - PctNeeded!) + GetAReal!(aDrawnPath + 0, PtNo + 1) * PctNeeded!
SetArrayReal aFramePosArray + 1, Frame, GetAReal!(aDrawnPath + l,PtNo) * (1 - PctNeeded!) + GetAReal!(aDrawnPath + 1, PtNo + 1) * PctNeeded!
SetArrayReal aFramePosArray + 2, Frame, GetAReal!(aDrawnPath + 2,PtN0) * (1 - PctNeeded!) + GetAReal!(aDrawnPath + 2, PtNo + 1) * PctNeeded!
NEXT
PtCount = GetA(aDrawnPath, 0) SetArrayReal aFramePosArray + 0, NoOfFrames, GetAReal!(aDrawnPath + 0, PtCount) SetArrayReal aFramePosArray + 1, NoOfFrames, GetAReal!(aDrawnPath + 1, PtCount) SetArrayReal aFramePosArray + 2, NoOfFrames, GetAReal!(aDrawnPath + 2, PtCount) GetOut:
END SUB
SUB CalcLXRXY
LXRXY.lx = XYZ.x - XYZ.Z / ZDivisor LXRXY.rx = XYZ.x + XYZ.Z / ZDivisor LXRXY.y = XYZ.y IF LXRXY.lx < LeftBound TIN LXRXY.lx = LeftBound IF LXRXY.rx < LeftBound TF~N LXRXY.rx = LeftBound IF LXRXY.lx > RightBOUnd TITiEN LXRXY.lx = RightBound IF LXRXY.rx > RightBound TF~N LXRXY.rx = RightBound IF LXRXY.y < Topbound THEN LXRXY.y = Topbound IF LXRXY.y > BottomBound TF~N LXRXY.y = BottomBound END SUB
SUB CalcMrkrPts MrkrPts.lx = LXRXY.lx - 4 MrkrPts.rx = LXRXY.rx - 4 -4 is displacement to center of cursor MrkrPts.y = LXRXY.y - 4 F~VD SUB
FUNCTION CalcTDist! (Vertex) x! _ (TPts(Vertex).x - XYZ.x) y! _ (TPts(Vertex).y - XYZ.y) Z! _ (TPts(Vertex).Z - XYZ.Z) CaICTDist! = SQR(x! * x! + y! * y! + Z! * Z!) END FUNCTION
FUNCTION CalcTetFrms CalcTetFrms = True FOR I = 1 TO NoOfFrames XYZ.x = GetAReal!(RawPtsXPg, I) XYZ.y = GetAReal!(RawPtsYPg, I) XYZ.Z = GetAReal!(RawPtsZPg, I) IF CalcTProps(I) = False THENN
CalcTetFrms = False EXIT FOR
END IF
NEXT

_ 87 -END FUNCTION
FUNCTION CalcTProps (WchFrame) DIM DisToVert(4) AS SINGLE
FOR I = 1 TO 4 DisTOVert(I) = Limits!(CalcTDist!(I), 0!, 350!) NEXT
TransGrfVal(WchFrame).PropA = 1 - DisToVert(1) / 350 TransGrfVal(WchFrame).PropB = 1 - DisToVert(2) / 350 TransGrfVal(WchFrame).PropC = 1 - DisToVert(3) / 350 TransGrfVal(WchFrame).PropD = 1 - DisToVert(4) / 350 SumProp! = TransGrfVal(WchFrame).PropA + TransGrfVal(WchFrame).PropB +
TransGrfVal(WchFrame).PropC + TransGrfVal(WchFrame).PropD
IF SumProp! <> 0 THEN
CalcTProps = True Mkl! = 1 / SumProp!
TransGrfVal(WchFrame).PropA = TransGrfVal(WChFrame).PropA * Mkl!
TransGrfVal(WchFrame).PropB = TransGrfVal(WchFrame).PropB * Mkl!
TransGrfVal(WchFrame).PropC = TransGrfVal(WchFrame).PropC * Mkl!
TransGrfVal(WchFrame).PropD = TransGrfVal(WchFrame).PropD * Mkl!
ELSE
CalcTProps = False END IF
END FUNCTION
SUB ChooseGrp (ChosenGrp, GrpText$) WHILE NOT GroupOK
ChosenGrp = UserChoice(GrpText$, Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, Group(5).Label) IF Confirm("Is " + Group(ChosenGrp).Label + " Correct?") THEN
GroupOK = True WEND
END SUB
SUB ChooseLineColor LOCATE 2, 30 INPUT "Line Color Number"; ColorNumber LOCATE 2, 30: PRINT SPACE$(40) IF ColorNumber > NoOfColors THEM NoOfColors = ColorNumber LineColor = ColorNumber LOCATE 2, 50: PRINT "Line Color:"; LineColor MyDelay 1 END SUB
SUB ChooseObj (ChosenObj, ObjText$) WHILE NOT ObjOK
ChosenObj = UserChoice(ObjText$, Object(1).Label, Object(2).Label, Object(3).Label, " , "") IF Confirm("Is " + Object(ChosenObj).Label + " Correct?") THEN
ObjOK = True WEND
ErsMnu END SUB
SUB ClearMtchPts FOR I = 0 TO 10 FOR J = 0 TO 7 MtchPts(I, J) = 0 _ 88 -NEXT
NEXT
MtchPtsOK = False END SUB
SUB ColorIt ColoringOK = False WHILE NOT ColoringOK
FOR I = 1 TO NoOfLines CLS
IF ALns(I).Looped = 1 THEN
ShowLn 1, I, -1 IF Confirm("Paint This Loop?") THIN
INPUT "Fill Color Number"; ColorNumber IF ColorNumber > NoOfColors THEN NoOfColors = ColorNumber ALns(I).PaintCol = ColorNumber ELSE
ALns(I).PaintCol = -1 END IF
END IF
NEXT
IF Confirm("Coloring OK?") THEN ColoringOK = True WEND
END SUB
FUNCTION Confirm (aQuestion$) DIM Done AS INTEGER
ErsMnu WndMnu aQuestion$, "x", "Yes", "No", "x", "x"
Done = False WHILE Done = False WndIn CalcFlatXY
CalcMrkrPts ShowFlatCrsr IF XYZ.y > 0 AND XYZ.y < 16 THEN
SELECT CASE XYZ.x CASE MBXVals(3) TO MBXVals(4): Done = True: Confirm = True CASE MBXVals(5) TO MBXVals(6): Done = True: Confirm = False END SELECT
END IF
WEND
MyDelay 1 ErsMnu END FUNCTION
SUB Construct (BeginFrame, FinishFrame, NoOfObjectsForThisRun) StartOver:
TotalNoOfFrames = FinishFrame - BeginFrame + 1 REDIM SegInfoLst(105) DIM Disp AS t3DPoint, StaticAncVal AS t3DPOint, PtVal AS t3DPoint, AncDisp AS t3DPoint REDIM ObjZDist(6) AS ZDistType SCREEN 9, , 0, 0 apage = 0: vpage = 1 K = 0 EndOfLastTransfer = 0 FinalRecordNo = 0: LastFinalRecordNo = 0 IF OneFrameOnly = False THEN CLS

AncRun = False GetObjDispVals = False Second = 1 ZCorrection = 40 LensFocalLength = 35 'INPUT "ZCorrec is 40, ZCorrection (larger no = smaller image)";
ZCorrection 'INPUT "Lens is 35, Lens (larger no = longer focal length)";
LensFocalLength IF OneFrameOnly = True THEN
Record$ _ "No"
CLS
GOTO ShowOneFrame END IF
REDOFLUFFS:

RecordDecisionOK = False WHILE NOT RecordDecisionOK
SELECT CASE UserChoice("RecordS4 Or RecordS6 Or View Mono?", " , "RecordS4", "RecordS6", "ViewMono", "") CASE 2: Record$ _ "RecordS4": RecordDecisionOK = True CASE 3: Record$ _ "RecordS6": RecordDecisionOK = True Record$ _ "No"
IF Confirm("You Will Not Be Able To Play Back This Run On Sandde4. Is That OK?") THIN
RecordDecisionOK = True END IF
END SELECT
WEND
CLS
SELECT CASE Record$
CASE "RecordS4"
SnapName$ = LEFT$(RunName$, 2) PRINT "SnapName$:"; SnapName$: SLEEP 1 SCREEN 9, , 1, 1 CLS
LOCATE 1, 1: PRINT SnapName$; TotalNoOfFrames SCREEN 9, , 0, 0 CLS
LOCATE 1, 1: PRINT SnapName$; TotalNoOfFrames Snapshot ASC(LEFT$(SnapName$, 1)) * 256 +
ASC(RIGHT$(SnapName$, 1)), NoOfFrames SCREEN 9, , 1, 1 CLS
SCREEN 9, , 0, 0 CLS
CASE "RecordS6"
FOR I = 1 TO NoOfLines IF ALns(I).LineCol > NoOfColors THEN
NoOfColors = ALns(I).LineCol IF ALns(I).PaintCol > NoOfColors THEN
NoOfColors = ALns(I).PaintCol NEXT

S6SaveName$ _ "K:\PROJECTS\IMAX\IMPORTS\" + RunName$ + ".SNI"
OPEN S6SaveName$ FOR RANDOM AS #2 LEN = LEN(TransferInfo) WriteXFerInfo ePaletteSize, NoOfColors, 0, 0, 0 END SELECT
ShowOneFrame:

FOR FrameNo = BeginFrame TO FinishFrame Disp.x = 0: Disp.y = 0: Disp.Z = 0 EndOfLastTransfer = 0: SaveWhlImgIndex = 0: SaveLineIndex = 0 TotalPts = 0 IF SaveThisRun = True THEN RecordFrameNo = FrameNo + EndFrameOfPrevRun ELSE RecordFrameNo = FrameNo IF Record$ _ "RecordS6" THEN
LOCATE 1, 10: PRINT "Recording ", RunName$; " To S6 ImportFile, Frame"; RecordFrameNo WriteXFerInfo eStartCel, TotalNoOfFrames, 0, 0, 0 END IF
ZDistIndex = 0 IF OneFrameOnly = True TF~1 LOCATE 5, 1: PRINT FrameNo 'determine z dist for each obj for this frame:
FOR ObjNo = 1 TO NoOfObjectsForThisRun ZDistIndex = ZDistIndex + 1 WchObjPath = Object(ObjNo).PathNo PathArrayPositPtr FrameNo, WchObjPath, ObjPathPosit ObjZDist(ZDistIndex).Dist = ObjPathPosit.Z +
Object(ObjNo).FakeZShift ObjZDist(ZDistIndex).ObjNo = ObjNo NEXT
'sort object z distances:
FOR I = ZDistIndex - 1 TO 1 STEP -1 FOR J = 1 TO I
IF ObjZDist(J).Dist > ObjZDist(J + 1).Dist THEN
SWAP ObjZDist(J).Dist, ObjZDist(J + 1).Dist SWAP ObjZDist(J).ObjNo, ObjZDist(J + 1).ObjNo END IF
NEXT
NE~C
'start actual animation construction:
FOR r = 1 TO ZDistIndex 'this goes thru objects in order of their zdist ObjNo = ObjZDist(r).ObjNo 'from back to front IF FrameNo >= Object(ObjNo).StartVis AND FrameNo <_ Object(ObjNo).EndVis THEN
K = 0 DO WHILE K <= NoOfAncRuns K = K + 1 IF AncRun(K).WchObj = ObjNo THEN
IF FrameNo >= AncRun(K).StartFrame AND
FrameNo <= AncRun(K).EndFrame THEN

AncRun = True AncObj = ObjNo AncGrp = AncRun(K).WchGrp AncLine = AncRun(K).WChLine AncSeg = AncRun(K).WChSeg AncPt = AncRun(K).WchPt FirstAncFrm = AncRun(K).StartFrame LastAncFrm = AncRun(K).EndFrame Second = 2 'will do two passes --first to get displacement. second to actually draw whole object in displaced psition EXIT DO
ELSE
AncRun = False Second = 1 'will do only one unanchored pass END IF
END IF
LOOP
FOR Pass = 1 TO Second GetObjDispVals = (AncRun = True AND Pass = 1) WchObjPath = Object(ObjNo).PathNo PathArrayPositPtr FrameNo, WchObjPath, ObjPathPosit IF Pass = 2 THEN
AObjCntr(ObjNo).x = AObjCntr(ObjNo).x - AncDisp.x AObjCntr(ObjNo).y = AObjCntr(ObjNo).y - AncDisp.y AObjCntr(ObjNo).Z = AObjCntr(ObjNo).Z - AncDisp.Z
END IF
'******* when using ancs maybe need to make obj cntr the pathposit so link can connect properly Disp.x = ObjPathPosit.x - AObjCntr(ObjNo).x Disp.y = ObjPathPOSit.y - AObjCntr(ObjNo).y Disp.Z = ObjPathPosit.Z - AObjCntr(ObjNo).Z
NegZ! = ObjPathPosit.Z / ZDivisor - ZCorrection PFac! = LensFocalLength / NegZ!
IF GetObjDispVals = True THEN
BeginGrp = AncGrp FinGrp = AncGrp ELSE
BeginGxp = 1 FinGrp = NoOfGroups END IF
FOR GroupNo = BeginGrp TO FinGrp IF Group(GroupNo).WchObj = ObjNo THEN
TransPtr FrameNo, GroupNo, AllProp FOR H = 1 TO NoOfVelcros IF VelcroAGrp(H).SlaveGzp = GroupNo THEN
ObjPathPosit = VelcroAGrp(H).HookXYZVals Disp.x = ObjPathPosit.x - AGrpCntr(GroupNo).x Disp.y = ObjPathPosit.y - AGrpCntr(GroupNo).y Disp.Z = ObjPathPosit.Z - AGrpCntr(GroupNo).Z
NegZ! = VelcroAGrp(H).HookXYZVals.Z / ZDivisor -ZCorrection PFac! = LensFocalLength / NegZ!
END IF
IF GetObjDispVals = True THEN
BeginLine = AncLine FinLine = AncLine ELSE
BeginLine = 1 FinLine = NoOfLines END IF
FOR LineNo = BeginLine TO FinLine 'wch lines belong to the grp SaveLineIndex = 0 IF GetObjDispVals = False THEN TempLineBegFinIndex = 0 TransPtr FrameNo, GrpNo, AllProp IF ALns(LineNo).WchGrp = GroupNo AND
ALns(LineNo).StartVis <= FrameNo AND
ALns(LineNo).EndVis >= FrameNo THEN
RecordingLine = LineNo IntermitLine = False IF ALns(LineNo).Intermit = True THEN
TransPtr FrameNo, GrpNo, AllProp 'this is to see if line should be shown IF ALns(LineNo).KeyForrn = 1 AND
ALns(LineNo).Threshold < AllProp.PropA THEN
InterrnitLine = True IF ALns(LineNo).KeyForm = 2 AND
ALns(LineNo).Threshold < AllProp.PropB THEN
IntermitLine = True IF ALns(LineNo).KeyForm = 3 AND
ALns(LineNo).Threshold < AllProp.PropC THEN
IntermitLine = True IF ALns(LineNo).KeyForm = 4 AND
ALns(LineNo).Threshold < AllProp.PropD THIN
IntermitLine = True END IF
IF ALns(LineNo).Intermit = False OR
(ALns(LineNo).Intermit = True AND IntermitLine = True) THEN
'either a not intermit line or tscript meets threshold criterion IF GetObjDispVals = True THEN
BeginSeg = AncSeg FinSeg = AncSeg ELSE
BeginSeg = 1 FinSeg = NoOfSegs END IF

FOR SegNo = BeginSeg TO FinSeg IF FinlSgs(SegNo).WchLine = LineNo TF~N
SumWarpDisp.x = 0 SumWarpDisp.y = 0 SumWarpDisp.Z = 0 SegInfLstIndx = 0 SegDist! = AllProp.PropA * TempSegs(SegNo).ADist +
AllProp.PropB * TempSegs(SegNo).BDist +
AllProp.PropC * TempSegs(SegNo).CDist +
AllProp.PropD * TempSegs(SegNo).DDist StartPt = FinlSgs(SegNo).Beg EndPt = FinlSgs(SegNo).Fin Grp = FinlSgs(SegNo).WchGrp 'find if seg has warp info and wch seginfolst it is (m):
IF FinlSgs(SegNo).WchInfoArr <> 0 THENN
FOR m = 1 TO AvlInfArr IF SegInfo(m).WchSeg = SegNo TF~N
SegInfLstIndx = SegInfLstIndx + 1 SegInfoLst(SegInfLstIndx) = m END IF
NEXT '(end of seg info) END IF
SegPtNo = 0 IF GetObjDispVals = True Tf~NN
BeginPt = AncPt FinPt = AncPt ELSE
BeginPt = StartPt FinPt = EndPt END IF
FOR PtNo = BeginPt TO FinPt IF GetObjDispVals = False TF~N
TempLineBegFinIndex = TempLineBegFinIndex + 1 IF IntermitLine = True TF~N
Conversion! = 1 / ALns(LineNo).Threshold SELECT CASE ALns(LineNo).KeyForm RevisedPropA! _ (AllProp.PropA -ALns(LineNo).Threshold)*Conversion!
RevisedPropB! _ AllProp.PropB * Conversion!
RevisedPropC! _ AllProp.PropC * Conversion!
RevisedPropD! _ AllProp.PropD * Conversion!

RevisedPropB! _ (AllProp.PropB -ALns(LineNo).Threshold)*Conversion!

RevisedPropA! _ AllProp.PropA * Conversion!
RevisedPropC! _ AllProp.PropC * Conversion!
RevisedPropD! _ AllProp.PropD * Conversion!

RevisedPropC! _ (AllProp.PropC -ALns(LineNo).Threshold)*Conversion!
RevisedPropB! _ AllProp.PropB * Conversion!
RevisedPropA! _ AllProp.PropA * Conversion!
RevisedPropD! _ AllProp.PropD * Conversion!

RevisedPropD! _ (AllProp.PropD -ALns(LineNO).Threshold)*Conversion!
RevisedPropB! _ AllProp.PropB * Conversion!
RevisedPropC! _ AllProp.PropC * Conversion!
RevisedPropA! _ AllProp.PropA * Conversion!
END SELECT
'adjust so props total 1 SumProp! = RevisedPropA! + RevisedPropB! +
RevisedPropC! + RevisedPropD!
Mkl! = 1 / SumProp!
AllProp.PropA = RevisedPropA! * Mk1!
AllProp.PropB = RevisedPropB! * Mkl!
AllProp.PropC = RevisedPropC! * Mk1!
AllProp.PropD = RevisedPropD! * Mkl!
END IF
AllSumdPt.x = AllProp.PropA
GetAReal!(APtsXPg, PtNo) +
AllProp.PropB
GetAReal!(BPtsXPg, PtNo) +
AllProp.PropC
GetAReal!(CPtsXPg, PtNo) +
AllProp.PropD
GetAReal!(DPtsXPg, PtNo) +
Disp.x AllSumdPt.y = AllProp.PropA
GetAReal!(APtsYPg, PtNo) +
AllProp.PropB
GetAReal!(BPtsYPg, PtNo) +
AllProp.PropC
GetAReal!(CPtsYPg, PtNo) +
AllProp.PropD
GetAReal!(DPtsYPg, PtNo) +
Disp.y AllSumdPt.Z = AllProp.PropA
GetAReal!(APtsZPg, PtNo) +
AllProp.PropB *
GetAReal!(BPtsZPg, PtNo) +
AllProp.PropC
GetAReal!(CPtsZPg, PtNo) +
AllProp.PropD
GetAReal!(DPtsZPg, PtNo) +
Disp.Z
IF FinlSgs(SegNo).WchInfoArr <> 0 TF~N
SegPtNo = PtNo - BeginPt + 1 GetSumWarpDisp SegInfoLst(), SegInfLstIndx, FrameNo, SegNo, SegPtNo, SumWarpDisp AllSumdPt.x = AllSumdPt.x + SumWarpDisp.x AllSumdPt.y = AllSumdPt.y + SumWarpDisp.y AllSumdPt.Z = AllSumdPt.Z + SumWarpDisp.Z
END IF
IF AncRun = False OR
(AncRun = True AND Second = 2) Tf~T
SaveLineIndex = SaveLineIndex + 1 'index for complete line (each pt of each seg of the line is added to this) SetArrayReal FastWorkArraylXPg, SaveLineIndex, ObjPathPosit.x - (PFac!
(AllSumdPt.x - ObjPathPosit.x)) SetArrayReal FastWorkArraylYPg, SaveLineIndex, ObjPathPosit.y - (PFac!
(AllSumdPt.y - ObjPathPosit.y)) SetArrayReal FastWorkArraylZPg, SaveLineIndex, ObjPathPosit.Z - (PFac!
(AllSumdPt.Z - ObjPathPosit.Z)) SetA FastWorkArraylXPg, 0, SaveLineIndex 'record pts of line without path position and perspective, so when saved appears in subsequent runs as first drawn:
IF SaveThisRun = True AND
FrameNo = FinishFrame TF~N
SaveWhlImgIndex = SaveWhlImgIndex + 1 SetArrayReal TempPtsXPg, SaveWhlImgIndex, AllSumdPt.x - Disp.x SetArrayReal TempPtsYPg, SaveWhlImgIndex, AllSumdPt.y - Disp.y SetArrayReal TempPtsZPg, SaveWhlImgIndex, AllSumdPt.Z - Disp.Z
SetA TempPtsXPg, 0, SaveWhlImgIndex END IF
END IF
IF GetObjDispVals = True TF~N
PtVal.x = ObjPathPosit.x - (PFac!
(AllSumdPt.x - ObjPathPosit.x)) PtVal.y = ObjPathPosit.y - (PFac!
(AllSumdPt.y - ObjPathPosit.y)) PtVal.Z = ObjPathPosit.Z - (PFac!

(AllSumdPt.Z - ObjPathPosit.Z)) IF FrameNo = FirstAncFrm THEN
StaticAncVal.x = PtVal.x StaticAncVal.y = PtVal.y StaticAncVal.Z = PtVal.Z
END IF
AncDisp.x = StaticAncVal.x - PtVal.x AncDisp.y = StaticAncVal.y - PtVal.y AncDisp.Z = StaticAncVal.Z - PtVal.Z
END IF
FOR q = 1 TO NoOfVelcros IF VelcroAGrp(q).HookPtIndex = PtNo AND
GetObjDispVals = False THEN
VelcroAGrp(q).HookXYZVals.x =
GetAReal!(FastWorkArraylXPg, SaveLineIndex) VelcroAGrp(q).HookXYZVals.y =
GetAReal!(FastWorkArraylYPg, SaveLineIndex) VelcroAGrp(q).HookXYZVals.Z =
GetAReal!(FastWorkArraylZPg, SaveLineIndex) END IF
NEXT
NEXT 'point along the seg END IF 'the seg belongs to the line NEXT 'seg IF GetObjDispVals = False THEN
SaveLineIndex = 0 'reset semifinalpts index to 0 TrnsfrWhlArray FastWorkArraylXPg, FastWorkArray2XPg LineCol = ALns(LineNo).LineCol PaintCol = ALns(LineNo).PaintCol IF Record$ _ "No" THEN DrawArray FastWorkArray2XPg, -1, True IF Record$ _ "RecordS4" THEN
SCREIN 9, , 0, 1 E~eDiff! = GetAReal!(FastWorkArray2ZPg, 1) /
ZDivisor XPt = GetAReal!(FastWorkArray2XPg, 1) - E~eDiff!
YPt = GetAReal!(FastWorkArray2YPg, 1) PSET (XPt, YPt), 1 FOR J = 2 TO GetA(FastWorkArray2XPg, 0) E~eDiff! = GetAReal!(FastWorkArray2ZPg, J) /
ZDivisor - 97 _ XPt = GetAReal!(FastWorkArray2XPg, J) - EyeDiff!
YPt = GetAReal!(FastWorkArray2YPg, J) LINE -(XPt, YPt), 1 NEXT
SCREEN 9, , 1, 0 E~eDiff! = GetAReal!(FastWorkArray2ZPg, 1) /
ZDivisor XPt = GetAReal!(FastWorkArray2XPg, 1) + EyeDiff!
YPt = GetAReal!(FastWorkArray2YPg, 1) PSET (XPt, YPt), 1 FOR J = 2 TO GetA(FastWorkArray2XPg, 0) EyeDiff! = GetAReal!(FastWorkArray2ZPg, J) /
ZDivisor XPt = GetAReal!(FastWorkArray2XPg, J) + EyeDiff!
YPt = GetAReal!(FastWorkArray2YPg, J) LINE -(XPt, YPt), 1 NEXT
END IF
IF ALns(LineNo).Looped = 0 TF~1 'not a loop IF Record$ _ "RecordS6" TF~N
WriteXFerInfo eStartEntity + eNonLooped +
eNonFilled, 0, 0, 0, 0 WriteXFerInfo eSetLineWidth, 1, 0, 0, 0 WriteXFerInfo eSetMix, 0, 0, 0, 0 WriteXFerInfo eSetColor, ALns(LineNo).LineCol, 0, 0, 0 WriteXFerInfo ePointAt, 0, GetAReal!(FastWorkArray2XPg, 1) - 320, GetAReal!(FastWorkArray2YPg, 1) - 175, -GetAReal!(FastWorkArray2ZPg, 1) + 1200) FOR J = 10 TO GetA(FastWorkArray2XPg, 0) STEP 10 WriteXFerInfo eLineTo, 0, GetAReal!(FastWorkArray2XPg, J) - 320, GetAReal!(FastWorkArray2YPg, J) - 175, -GetAReal!(FastWorkArray2ZPg, J) + 1200) NEXT 'non closed line is finished J = GetA(FastWorkArray2XPg, 0) IF J MOD 10 <> 0 TIN
WriteXFerInfo eLineTo, 0, GetAReal!(FastWorkArray2XPg, J) - 320, GetAReal!(FastWorkArray2YPg, J) - 175, -GetAReal!(FastWorkArray2ZPg, J) + 1200) END IF
END IF 'if not a loop IF ALns(LineNo).Looped > 0 TI-~'NN 'line is a loop IF Record$ _ "RecordS6" TF~N
IF PaintCol <> -1 TF~N 'paint col -1 is flag for no fill WriteXFerInfo eStartEntity + eLooped +
eFilled, ALns(LineNo).PaintCol, 0, 0, 0 ELSE
WriteXFerInfo eStartEhtity + eLooped, 0, 0, 0, 0 END IF
WriteXFerInfo eSetLineWidth, 1, 0, 0, 0 WriteXFerInfo eSetMix, 0, 0, 0, 0 WriteXFerInfo eSetColor, ALns(LineNo).LineCol, 0, 0, 0 writeXFerInfo ePOintAt, 0, GetAReal!(FastWorkArray2XPg, 1) - 320, GetAReal!(FastWorkArray2YPg, 1) - 175, -GetAReal!(FastWorkArray2ZPg, 1) + 1200) FOR J = 10 TO GetA(FastWorkArray2XPg, 0) STEP 10 WriteXFerInfo eLineTo, 0, GetAReal!(FastWorkArray2XPg, J) - 320, GetAReal!(FastWorkArray2YPg, J) - 175, -GetAReal!(FastWorkArray2ZPg, J) + 1200) NEXT
WriCeXFerInfo eLineTo, 0, GetAReal!(FastWorkArray2XPg, 1) - 320, GetAReal!(FastWorkArray2YPg, 1) - 175, -GetAReal!(FastWorkArray2ZPg, 1) + 1200) END IF 'if record=S6 END IF 'if line is a loop END IF 'IF GetObjDispVals = False END IF 'if Threshold ok END IF 'if line belongs to object ALns(LineNo).TempFin = TempLineBegFinIndex NEXT 'line END IF 'if grp belongs to object NEXT 'Group NEXT 'Pass IF FrameNo > FinishFrame - 6 THEN
IF ObjNo = 1 THEN ObjFinalPositions(FinishFrame - FrameNo).
FinalPositObjl = ObjPathPosit IF ObjNo = 2 THEN ObjFinalPositions(FinishFrame - FrameNo).
FinalPositObj2 = ObjPathPosit IF ObjNo = 3 THEN ObjFinalPositions(FinishFrame - FrameNo).
FinalPositObj3 = ObjPathPosit END IF
END IF 'if visible NEXT 'object IF OneFrameOnly = True THEN GOTO Skip2:
IF Record$ _ "No" THEN

LOCATE 1, 1: PRINT RecordFrameNo SWAP apage, vpage SCREEN 9, , apage, vpage CLS
END IF
IF Record$ _ "RecordS4" THEN
SCREE<~1 9 , , 0 , 1 LOCATE 1, 1: PRINT SnapName$; RecordFrameNo SCREEN 9, , 1, 0 LOCATE 1, 1: PRINT SnapName$; RecordFrameNo Snapshot ASC(LEFT$(SnapName$, 1)) * 256 +
ASC(RIGHT$(SnapName$, 1)), RecordFrameNo SCREEN 9, , 1, 0 CLS
SCREEN 9, , 0, 1 CLS
END IF
ALns(1).Beg = 1: ALns(1).Fin = ALns(1).TempFin FOR I = 2 TO NoOfLines ALns(I).Beg = ALns(I - 1).Fin + 1 ALns(I).Fin = ALns(I).Beg + ALns(I).TempFin - 1 NEXT

_ 99 _ IF SaveThisRUn = True AND FrameNo = FinishFrame THEN
BEEP
OPEN "k:\Projects\Imax\Tweeny\Paul\" + RunName$ + ".TWS" FOR
BINARY AS #1 EndOfPts = GetA(T~npPtsXPg, 0) PUT #1, , EndOfPts FOR I = 1 TO EndOfPts XVal! = GetAReal!(TempPtsXPg, I) YVal! = GetAReal!(TempPtsYPg, I) ZVal! = GetAReal!(TempPtsZPg, I) PUT #1, , XVal!
PUT #1, , YVal!
PUT #1, , ZVal!
NEXT
SCREEN 9, , 0, 0 CLS
PRINT "recorded array"
DrawPartialArray TempPtsXPg, 2, GetA(Te~PtsXPg, 0), -1, False SCREEN 9, , apage, vpage PUT #1, , NoOfLines FOR I = 1 TO NoOfLines PUT #2, , ALns(I) NEXT
PUT #1, , NoOfGroups FOR I = 1 TO NoOfGroups PUT #1, , Group(I) NEXT
PUT #1, , NoOfObjects FOR I = 1 TO NoOfObjects PUT #1, , Object(I) NEXT
FOR I = 1 TO NoOfObjects PUT #1, , AObjCntr(I) NEXT
FOR I = 1 TO 5 PUT #1, , ObjFinalPositions(I) NEXT
PUT #1, , RecordFrameNo CLOSE #1 END IF
Skip2:
NEXT 'FrameNo IF OneFrameOnly = True THEN GOTO OneFrameOnlySkip SCREEN 9, , 0, 0 LOCATE 10, 1: PRINT RunName$; RecordFrameNo IF Record$ _ "No" THEN LOCATE 11, 1: PRINT "NOT RECORDED!"
SCREEN 9, , 1, 1 LOCATE 10, 1: PRINT RunName$; RecordFrameNo IF Record$ _ "No" THEN LOCATE 11, 1; PRINT "NOT RECORDED!"

IF Record$ _ "RecordS6" THEN
CLOSE #2 PRINT "closed S6"
END IF

IF Confirm("See Again?") THEN
IF Confirm("Make Adjustments?") THEN
SELECT CASE UserChoice("Adjust What?", "", "VisInvis", "IntermitLn", "", "") CASE 2: MrkVisInvisLine CASE 3: MrklntermtLine END SELECT
END IF
GOTO StartOver END IF
OneFrameOnlySkip:

END SUB
5UB CrsrOn PUT (10, 10), LCrsr: PUT (20, 10), RCrsr LastMrkrPts.lx = 10: LastCrsPos.rx = 10: LastCrsPos.y = 0 LastCrsPos.lx = 10: LastCrsPos.rx = 20: LastCrsPOS.y = 10 END SUB
SUB D3Wave (RequiredLengthOfWave) CLS
WaveRefOK = False WHILE NOT WaveRefOK
DO
CLS
DefnPt WaveRefStart, "Mrk Start Of Wave Reference Line (Must Be Longer Than Wave To Be Drawn)", "DefnStartWaveRefLine", 3 SetArrayReal FastWorkArraylXPg, 1, XYZ.x SetArrayReal FastWorkArraylYPg, 1, XYZ.y SetArrayReal FastWorkArraylZPg, 1, XYZ.Z
DefnPt WaveRefEnd, "Mrk End Of Wave Reference Line", "DefriEndWaveRefLine", 3 SetArrayReal FastWorkArraylXPg, RequiredLengthOfWave, XYZ.x SetArrayReal FastWorkArraylYPg, RequiredLengthOfWave, XYZ.y SetArrayReal FastWorkArraylZPg, RequiredLengthOfWave, XYZ.Z
SetA FastWOrkArraylXPg, 0, RequiredLengthOfWave Interpo FastWorkArraylXPg, 1, RequiredLengthOfWave DrawPartialArray FastWorkArraylXPg, 1, RequiredLengthOfWave, -1, True LOOP UNTIL Confirm("Ref Line OK?") DO
MkUniPath "Wave ", eWaveShape LOOP UNTIL Confirm("OK?") PRINT "Required Length"; RequiredLengthOfWave PRINT "Length="; GetA(TempPtsXPg, 0) IF RequiredLengthOfWave <= GetA(TetnpPtsXPg, 0) THEN
WaveRefOK = True ELSE
LOCATE 2, 30: PRINT "Wave Too Short, ReDo ". SLEEP 2 CLS

END IF
WEND
PRINT "Figuring..."
istart = 1: jstart = 1 'wave is temppts(j), refline is workarrayl(i) FOR J = 1 TO GetA(TempPtsXPg, 0) 'travels along wave PrevDist! = 0 K = 0 FOR I = istart TO RequiredLengthOfWave 'travels along refline K = K + 1 ThisDist! = DistBet2Pts!(FastWorkArraylXPg, TempPtsXPg, I, J) IF K > 1 AND PrevDist! < ThisDist! THEN
SetArrayReal FastWorkArray2XPg, J, GetAReal!(FastWorkArraylXPg, I - 1) -GetAReal!(TempPtsXPg, J) SetArrayReal FastWorkArray2YPg, J, GetAReal!(FastWorkArraylYPg, I - 1) -GetAReal!(TempPtsYPg, J) SetArrayReal FastWorkArray22Pg, J, GetAReal!(FastWorkArraylZPg, I - 1) -GetAReal!(TempPtsZPg, J) LINE (J + 10, 136 + GetAReal!(FastWorkArray2YPg, J))-(J + 10, 137 + GetAReal!(FastWorkArray2YPg, J)) istart = I - 2 EXIT FOR
END IF
PrevDist! = ThisDist!
NEXT
NEXT

SetA FastWorkArray2XPg, 0, RequiredLengthOfWave 'main program puts FastWorkArray2XPg into JAPtsXPg etc.
END SUB
SUB DefnGrpsObjs DO WHILE GroupsDefnd = False ShortCutGroups IF GroupsDefnd = True THEN EXIT DO
IdentGroups LOOP
WHILE GroupsNamed = False NameGroups WEND
DO WHILE ObjectsDefnd = False ShortCutObjects IF ObjectsDefnd = True THEN EXIT DO
IdentObjects LOOP
WHILE ObjectsNamed = False NameObjects WEND
FOR I = 1 TO NoOfObjects Object(I).StartVis = 1 Object(I).EndVis = NoofFrames NEXT
FOR I = 1 TO NoOfObjects ShowObj I, 1 NEXT
END SUB

SUB DefnObjCntrs FOR I = 1 TO NoOfObjects IF LinkingToPreviousRun = True THEM
FirstPoseToMark = 2 DrawPartialArray APtsXPg, 1, GetA(APtsXPg, 0), -1, False XYZ = AObjCntr(I): Mrk 2, 1 LOCATE 2, 30 PRINT "Note Handle Posit (Triangle) In This Object In Previous Run. (Press Any Key)"
SLEEP
LOCATE 2, 30: PRINT SPACE$(79) ELSE
FirstPoseToMark = 1 END IF
FOR Pose = FirstPoseToMark TO 4 IF FirstPoseToMark = 1 THEN CLS
ShowObjectSegs I, Pose, -1, True F$ _ "Click 0n A Point To Use As A Handle For <" +
CHR$(POSe + 64) + "> Source Pose of " + Object(I).Label +
" OBJECT"
MrkObjCntr F$, Pose, I
NEXT
ReCntrObj I, BPtsXPg, BObjCntr() ReCntrObj I, CPtsXPg, CObjCntr() ReCntrObj I, DPtsXPg, DObjCntr() CLS
FOR J = 1 TO 4 LOCATE 3, 1: PRIrIT "Pose"; J; "Of "; Object(I).Label; " OBJECT"
ShowObjectSegs I, J, -1, True CLS
NEXT
NEXT
IF NoOfGroups > 1 THEN
FOR I = 1 TO NoOfGroups FOR Pose = 1 TO 4 CLS
ShowGrp Pose, I, -1 F$ _ "Click On A Point To Use As A Handle For <" +
CHR$(Pose+64) + "> Source Pose of " + Group(I).Label +
" GROUP"
MrkGrpCntr F$, Pose, I
NEXT
ReCntrGrp I, BPtsXPg, BGrpCntr() ReCntrGrp I, CPtsXPg, CGrpCntr() ReCntrGrp I, DPtsXPg, DGrpCntr() CLS
NEXT
END IF
END SUB
SUB DefnPt (DefndPoint AS t3DPOint, Message, PtIsFor$, WchMrkr) IF PtISFor$ = "DefnScaffoldPts" OR PtIsFor$ _ "MarkSpaceRefPts" THEN
C$ _ "Done" ELSE C$ _ "x"
WndChs "" "x", "x", C$, "x", "x", Ans$, 1 LOCATE 2,,1: PRINT Message$
Finished = False DO

Wndln ShowCrsr IF INP(889) < 128 THEN
DefndPoint = XYZ
Mrk WchMrkr, 1 MyDelay 1 Finished = True END IF
IF PtIsFOr$ _ "DefnScaffoldPts" OR PtIsFOr$ _ "MarkSpaceRefPts" THEN
IF XYZ.y < 15 THEN
WndSlct Ans$, 0 IF Ans$ = C$ THIN MyDelay 1: EXIT DO
END IF
END IF
IF Finished = True THEN EXIT DO
LOOP
LOCATE 2, 1: PRINT SPACE$(79) END SUB
SUB DefnSegWarp (WarpNumber, AvlPth, AvlWarpProflArray) AvlPthOnEntryToWarp = AvlPth WaveLen = 0 SumPrev = 0 NoInSrs = 0 SegWarp = False: WaveWarp = False: UsesPrevPath = False AllDone = False: SegOK = False WarpNo = WarpNiunber CLS
'***************** What klrid Of Warp REDOLINK:
Text$ _ "Link " + Warp(WarpNumber).Label + " To"
A$ _ "Wind": B$ _ "Iner": C$ _ "Time": D$ _ "Wave"
WndChs Text, A$, B$, C$, D$, "x", Ans$, 0 Kind$ = Ans$
SELECT CASE Ans$
CASE A$, B$, C$
SegWarp = True: AvlPth = AvlPth + 1 AvlWarpProflArray = AvlWarpProflArray + 1 CASE D$
WaveWarp = True: WaveNo = WaveNO + 1 AvlWarpProflArray = AvlWarpProflArray + 1 'used for seg wave warp profile A$ _ "1": BS = "2": C$ _ "4": D$ _ "6~: E$ _ ~8"
WndChs "Wave Speed?", A$, B$, C$, D$, E$, Ans$, 0 WaveSpeed = VAL(Ans$) B$ _ "HeadToTail": C$ _ ~TailToHead"
WndChs "Wave Moves Which Direction On Seg?", "x" g$~ C$, "x" "x" Ans$, 0 SELECT CASE Ans$
CASE B$: Direc$ _ "HtoT"
CASE C$: Direc$ _ "TtoH"
END SELECT
B$ _ "On Seg": C$ _ "OffSeg": WndChs "Wave Starts~, "x" B$ C$. ,"x" "x" Ans$, 0 SELECT CASE Ans$
CASE B$: 'overlap at start B$ _ "On Seg": C$ _ "OffSeg": WndChs "Wave Ends ", ~x", B$, C$, "x", "x", Ans$, 0 SELECT CASE Ans$
CASE B$: Overlap = 0 ' overlap at end CASE C$: Overlap = 1 ' no overlap at end END SELECT
CASE C$: 'no overlap at start B$ _ "On Seg": C$ _ "OffSeg": WndChs "Wave Ends ", "X", B$, C$, "x", "x", Ans$, 0 SELECT CASE Ans$
CASE B$: Overlap = 2 ' overlap at end CASE C$: Overlap = 3 ' no overlap at end END SELECT
END SELECT 'WL is multiplied by NoFrames and Speed just before call to D3 END SELECT
******************* use a previous warp path or wave?
IF WarpNo > 1 TFIEN
IF Kind$ _ "Time" OR Kind$ _ "Iner" OR Kind$ _ "Wind" THEN
Text$ _ "Use Just Previous Warp Path? (Displacement is Between Path and Warp Handle)"
IF Kind$ _ "Wave" THEN Text$ _ "Use Just Previous Wave?"
IF Confirm(Text$) THEN
UsesPrevPath = True AvlPth = AvlPth - 1 END IF
END IF
'********** show segs, place handle and choose which segs to be warped DrawPartialArray APtsXPg, 1, FinlSgs(NoOfSegs).Fin, -1, False ShowAllSegStarts IF SegWarp = True THEN
IF UsesPrevPath = False THEN Text$ _ "Mrk Warp Path Handle On Seg "
ELSE Text$ _ "Mrk Warp Handle Same Place As Previous "
FindMrkdPtInAPose Hndl, Text$
END IF
D$ _ "Done": WndChs "Mrk Seg(s) to be Warped ", "X", "X", "X", DS, "X", AT1S$, 1 DO WHILE AllDone = False WndIn ShowCrsr IF XYZ.y < 15 THEN
WndSlct Ans$, 0 IF Ans$ = D$ AND SegOK = True THEN AllDone = True: EXIT DO
END IF
IF INP(889) < 128 THEN
FoundIt = False WHILE FoundIt = False FindInApts FoundSegPt IF FoundIt = False THEN GetWndXYZ 0 WIND
MyDelay 1 FoundSeg = FindWchFinlSg(FinlSgs(), FoundSegPt) FOR J = 1 TO NoInSrs IF FoundSeg = WarpSrs(J, 1) THEN
SegOK = False: LOCATE 2, 1: PRINT "Seg Mrked Already"

Mrk 0, 1: MyDelay 1: LOCATE 2, 1: PRINT SPACE$(30) END IF
NEXT
ChoiceInSegHili = True HiLiFinlSg FoundSeg FinlSgs(FoundSeg).WarpNo = WarpNo SegOK = True Length = FinlSgs(FoundSeg).Fin - FinlSgs(FoundSeg).Beg + 1 PreviousSumPrev = SumPrev SumPrev = SumPrev + Length NoInSrs = NoInSrs + 1 WarpSrs(NoInSrs, 1) = FoundSeg WarpSrs(NoInSrs, 0) = Length AvlInfArr = AvlInfArr + 1 FinlSgs(FoundSeg).WchInfoArr = AvlInfArr SegInfo(AvlInfArr).WchSeg = FoundSeg SegInfo(AvlInfArr).SegLen = Length IF SegWarp = True THEN
SegInfo(AVIInfArr).Hndl = Hndl Seglnfo(AVIInfArr).WchPath = AvlPth 'if prevpath is used this is what sets same path as prey warp for this warp END IF
IF WaveWarp = True THEN
SegInfo(AvlInfArr).WchWave = WaveNo SegInfo(AvlInfArr).WaveSpeed = WaveSpeed SegInfo(AvlInfArr).Direc = Direc$
Seglnfo(AvlInfArr).OverLap = Overlap 'wave starts ends on off seg WaveLen = SumPrev END IF
'the following is common for seg and wave warps SegInfo(AvlInfArr).WchProf = AvlWarpProflArray SegInfo(AvlInfArr).Kind = Kind$
IF NoInSrs = 1 THEN SegInfo(AvlInfArr).ProfBeg = 1 IF NoInSrs > 1 THEN SegInfo(AvlInfArr).ProfBeg = PreviousSumPrev IF NoInSrs = NoOfSegs THEN EXIT DO
D$ _ "Done"
WndChs "Mrk Seg(s) to be Warped ", "x", "x", "x", D$, "x", Ans$, 1 END IF 'button pushed POOP
IF SegWarp = True THEN '(warp is not a wave warp) SyncPtIndexAtStartOfWarp = SyncPtIndex IF UsesPrevPath = False THEN
'******************** draw path fOr handle Do PathOk = False PathError = False DO WHILE PathOk = False MkUniPath "Segment Warp ", eWarpPath IF Confirm("OK?") THEN
PathOk = True ELSE
DrawArray TempPtsXPg, 0, True ENDIF
LOOP
IF LnEndsClose(TempPtsXPg, 1, GetA(TempPtsXPg, 0), 20) THEN
IF Confirm("Mk Cycle?") THEN
DrawArray TempPtsXPg, 0, False SmoothJoin TempPtsXPg, 30 DrawArray TempPtsXPg, -1, False END IF
END IF
~******************** tlme Wdrp IF Kind$ _ "Time" THEN
I = WarpNumber CLS
DrawPartialArray TempPtsXPg, 1, GetA(TempPtsXPg, 0), -1, False SELECT CASE UserChoice("Use Warp Path Sync Pts?", " , "On Path", "OnFrmChrt", "No", "") CASE 2 'on path PlaceSyncPtsOnTempPath 3, I, " Warp " +
Warp(WarpNumber).Label SortSyncPtsForApplic 3, I
SwapSortedSyncPts CASE 3 'on frm chrt ShowSyncPtLines SyncPtIndexAtStartOfWarp PlaceSyncPtsOnFrmChrt 3, I, " Warp " +
Warp(WarpNumber).Label SortSyncPtsForApplic 3, I
SwapSortedSyncPts DrawArray TempPtsXPg, -1, False PlaceFrmChrtSyncPtsOnPath 3, I

SortSyncPtsForApplic 3, I
SortedS~ncPts(1).Frame = 1 SortedSyncPts(1).TempPtsIndex = 1 SortedSyncPts(2).Frame = NoOfFrames SortedSyncPts(2).TempPtsIndex = GetA(TempPtsXPg, 0) END S$LECT
RedoVelGraphForWarp:
Text$ _ "Velocity Graph For Movement Of Warp Handle Along Warp Path"
DoVelocityGraph TempPtsXPg, RawPtsXPg, Text$
END IF
LOOP WHILE PathError = True ****************** if inertia warp then get accelerations RedoIner:

IF Kind$ _ "Iner" THEN 'have to smooth velocities for a smooth curve '******* derive acceleration and find max accel CLS
FOR I = 1 TO NoOfFrames SetArrayReal FastWorkArraylXPg, I, FrmToFrmVelocity!(I) * 100 NEXT
SetArrayReal FastWorkArraylXPg, 0, NoOfFrames SetArrayReal FastWorkArraylXPg, 1, GetAReal!(FastWorkArraylXPg, 2) SetArrayReal FastWorkArraylXPg, 0, GetAReal!(FastWorkArraylXPg, 2) FOR I = 1 TO NoOfFrames LOCATE 2, 1: PRINT "original frm to frm vel * 100"; I
LINE (I, 150)-(I, 150 + GetAReal!(FastWorkArraylXPg, I)), 10 NEXT
FOR I = 1 TO NoOfFrames FrmTOFrmAccel! = GetAReal!(FastWorkArraylXPg, I) -GetAReal!(FastWorkArraylXPg, I - 1) SetArrayReal FastWorkArray2XPg, I, FrmToFrmACCel!
NEXT
SetArrayReal FastWOrkArray2XPg, 1, GetAReal!(FastWorkArray2XPg, 2) FOR I = 1 TO NoOfFrames LOCATE 2, 1: PRINT "raw frm to frm accel"; I
LINE (I, 150)-(I, 150 + GetAReal!(FastWorkArray2XPg,I)*4), 11 NEXT
SLEEP
SetArrayReal FastVJorkArray2XPg, 0, NoOfFrames Smooth FastWorkArray2XPg, FastWorkArraylXPg, 2, False Smooth FastWorkArraylXPg, FastWorkArray2XPg, 2, False Smooth FastWorkArray2XPg, FastWorkArraylXPg, 2, False Smooth FastWorkArraylXPg, FastWorkArray2XPg, 2, False FOR I = 1 TO NoOfFrames LOCATE 2, 1: PRINT "smoothed frm to frm accel"; I
LINE (I, 150)-(I, 150 + GetAReal!(FastWorkArray2XPg, I) * 4),13 NEXT
SLEEP
FOR I = 1 TO NoOfFrames IF MaxAccel! < GetAReal!(FastWorkArray2XPg, I) THEN
MaxAccel! = GetAReal!(FastWorkArray2XPg, I) NEXT
'******* use half of inertia warp path becuz shift index 'goes pos or neg, so total excursion = len of warp path '!! warp path shld be smoothed, becuz accel controls position on it, not some other velocity Smooth TempPtsXPg, FastWorkArraylXPg, 5, False Smooth FastWorkArraylXPg, TempPtsXPg, 5, False HalfOfWarpPath! = GetA(TempPtsXPg, 0) / 2 FOR q = 1 TO NoOfFrames PercentOfMaxACCel! = GetAReal!(FastWorkArray2XPg, q) / MaxAccel!
'******* set ShiftIndex for each frame as a percentage of 'the length of half the Warp Path (which is in temppts) 'ShiftIndex! = PercentOfMaxAccel! * HalfOfWarpPath!
Friction! _ .75: Flexibility! = 15 NewACCel! = NewAccel! - POSIT! / Flexibility! +
GetAReal!(FastWOrkArray2XPg, q) IF POSIT! > 0 THEN FrictionEffect! = Friction!
IF POSIT! < 0 THEN FrictionEffect! _ -Friction!
POSIT! = POSIT! + NewACCel! - FrictionEffect!
ShiftIndex! = POSIT!
shift = CINT(ShiftIndex!) LOCATE 2, 1: PRINT "shift"; q LINE (q, 150)-(q, 150 + shift), 15 '******* when accel is 0 the position on the warp path is 'half way along it so it can swing pos or neg:
FinalTempPtsIndex = HalfOfWarpPath! + ShiftIndex!
IF FinalTempPtsIndex < 1 THEN FinalTempPtsIndex = 1 IF FinalTempPtsIndex > GetA(TempPtsXPg, 0) THEN
FinalTempPtsIndex = GetA(TempPtsXPg, 0) SetArrayReal RawPtsXPg, q, GetAReal!(TempPtsXPg, FinalTempPtsIndex) SetArrayReal RawPtsYPg, q, GetAReal!(TempPtsYPg, FinalTempPtsIndex) SetArrayReal RawPtsZPg, q, GetAReal!(TempPtsZPg, FinalTempPtsIndex) CIRCLE (GetAReal!(RawPtsXPg,q), GetAReal!(RawPtsYPg,q)), 3, 10 NEXT
SetA RawPtsXPg, 0, NoOfFrames Sr ~F'.F'.P
END IF
RedoAirF:
IF Kind$ _ 'Wind" THEN
'******** find max wind velocity FOR P = 1 TO NoOfFrames IF MaxWindVel! < FrntfoFrmVelocity!(P) THEN
MaxWindVel! = FrmToFrmVelocity!(P) IF MaxWindVel! = 0 THEN MaxWindVel! _ .O1 '******** get wind velocity for each frame as a percentage of max velocity FOR q = 1 TO NoOfFrames PercentMaxFrmVel! = FrmToFrmVelocity!(q) / MaxWindVel!
'******* set ShiftIndex for each frame as a percentage of 'the length of the Wind Warp Path (which is in temppts) ShiftIndex! = PercentMaxFrmVel! * GetA(TempPtsXPg, 0) IF ShiftIndex! > GetA(TempPtsXPg, 0) TIN ShiftIndex! _ GetA(TempPtsXPg, 0) IF ShiftIndex! < 1 TFiEr1 ShiftIndex! = 1 *******
SetArrayReal RawPtsXPg, q, GetAReal!(TempPtsXPg, CINT(ShiftIndex!)) NEXT
SetA RawPtsXPg, 0, NoOfFrames Smooth RawPtsXPg, TempPtsXPg, 3, False FOR q = 1 TO NoOfFrames CIRCLE (GetAReal!(TempPtsXPg,q), GetAReal!(TempPtsYPg,q)),3,10 NEXT
END IF
IF NOT Confirm("OK?") TF~1 IF Kind$ _ "Iner" TII~NN GOTO Redolner IF Kind$ _ "AirF" TF~N GOTO RedoAirF
IF Kind$ _ "Time" GOTO RedoVelGraphFOrWarp END IF
END IF 'if uses prevpath END IF
IF WaveWarp = True AND UsesPrevPath = False TFiENN
FOR I = 1 TO NoInSrs TotalSegsLen = TotalSegsLen + WarpSrs(I, 0) NEXT
SELECT CASE Overlap CASE 0: WL = 2 * Length * WaveSpeed 'ol at start of at end CASE 1: WL = Length * WaveSpeed 'ol at start no of at end CASE 2: WL = Length * WaveS~eed 'no of at start of at end CASE 3: WL = Length * WaveSpeed 'no of at start no of at end 'WL is needed length of wave END SELECT
D3Wave WL
END IF
CLS
' main program now puts RawPts into avlpath ' if a wave warp main program now puts FastWorkArray2XPg into JAPtsXPg etc.
END SUB
SUB DelLast (WchPose) IF WchPose = 1 TF~N DelLastLnPart2 ALns(), APtsXPg, WchPose IF WchPose = 2 Tf~N DelLastLnPart2 BLns(), BPtsXPg, WchPose IF WchPose = 3 THEN DelLastLnPart2 CLns(), CPtsXPg, WchPose IF WchPose = 4 THEN DelLastLnPart2 DLns(), DPtsXPg, WchPose END SUB
SUB DelLastLnPart2 (LnArray() AS LineType, PtArray, WchPose) Start = LnArray(LnNO).Beg 'start of last line Finish = LnArray(LnNo).Fin 'end DrawPartialArray PtArray, Start, Finish, 0, True LnNo = LnNo - 1 IF LnNo > 0 THEN ShowGuideLn WChPOSe SetA APtsXPg + 3 * (WchPOSe - 1), 0, LnArray(LnNo).Fin SetA RawPtsXPg, 0, 0 IF WchPose = 1 THEN
NoOfLines = NoOfLines - 1 ALns(0).Beg = NoOfLines END IF
END SUB
FUNCTION DistBet2Pts! (aArrayl, aArray2, aPointIndexl, aPOintIndex2) dx! = GetAReal(aArrayl + 0, aPOintIndexl) -GetAReal(aArray2 + 0, aPOintIndex2) DY! = GetAReal(aArrayl + 1, aPOintIndexl) -GetAReal(aArray2 + 1, aPOintIndex2) DZ! = GetAReal(aArrayl + 2, aPointIndexl) -GetAReal(aArray2 + 2, aPOintIndex2) DistBet2Pts! = SQR(dx! * dx! + DY! * DY! + DZ! * DZ!) END FUNCTION
FUNCTION DistToNextPoint! (aArray, aPointIndex) dx! = GetAReal(aArray + 0, aPointIndex) -GetAReal(aArray + 0, aPointIndex + 1) DY! = GetAReal(aArray + 1, aPointIndex) -GetAReal(aArray + 1, aPointIndex + 1) DZ! = GetAReal(aArray + 2, aPointIndex) -GetAReal(aArray + 2, aPointIndex + 1) DistTONextPoint! = SQR(dx! * dx! + DY! * DY! + DZ! * DZ!) END FUNCTION
SUB DoVelocityGraph (aDrawnPath, aFramePosArray, Text) ErsMnu GetVelGraphFromPath (aDrawnPath) Done = False DO WHILE Done = False CalcFramePositions aDrawnPath, aFramePosArray IF PathError = True THEN EXIT DO
DrawVelGraph aDrawnPath, aFramePosArray LOCATE 3, 1: PRINT "FAST"
LOCATE 3, 1: PRINT Text$
LOCATE 4, 39: PRINT "Use REVISE To Enable Sync Pts"
SELECT CASE UserChoice("", "", "OK To Try", "Revise", "", "") CASE 2: Done = True CASE 3: GetVelGraphFromUser (aDrawnPath) END SELECT
L(bP
END SUB
SUB Draw3DLine (aPointl AS t3DPoint, aPoint2 AS t3DPoint, aColor AS INTEGER) LX1 = CINT(aPointl.x - aPointl.Z / ZDivisor) LX2 = CINT(aPoint2.x - aPoint2.Z / ZDivisor) RX1 = CINT(aPointl.x + aPointl.2 / ZDivisor) RX2 = CINT(aPoint2.x + aPoint2.Z / ZDivisor) IF aColor = -1 THEN
IF LX1 = RX1 AND LX2 = RX2 THEN
LINE (LX1, aPointl.y)-(LX2, aPoint2.y), 13 ELSE
LINE (LX1, aPointl.y)-(LX2, aPoint2.y), LCol LINE (RX1, aPOintl.y)-(RX2, aPoint2.y), RCol END IF
ELSE
LINE (LX1, aPointl.y)-(LX2, aPoint2.y), aColor LINE (RX1, aPointl.y)-(RX2, aPoint2.y), aColor END IF
END SUB
' Draw a three-D point on the screen : Color -1 indicates anaglyph SUB Draw3DPoint (aPoint AS t3DPoint, aColor AS INTEGER) lx = CINT(aPoint.x - aPoint.Z / ZDivisor) rx = CINT(aPoint.x + aPoint.Z / ZDivisor) IF aColor = -1 THEN
IF lx = rx THEN
PSET (lx, aPoint.y), 13 ELSE
PSET (lx, aPOint.y), LCol PSET (rx, aPOint.y), RCol END IF
ELSE
PSET (lx, aPoint.y), aColor PSET (rx, aPoint.y), aColor END IF
END SUB
SUB DrawAPose CLS
LineColor = 1 'Default color to start Drawling 1 END SUB
SUB DrawArray (aArray, aColor, aUseLines) DrawPartialArray aArray, 1, GetA(aArray, 0), aColor, aUseLines END SUB
SUB DrawBCDPoses WHILE DrawBPOSeOK = False CLS
LINE (10, 29)-(630, 340), 5, B
IF Scaffold = True THEN
MrkScaffoldCntr "Mark Scaffold Center For B Pose", 1, 2 ShowScaffold 2 XYZ = BScaffoldCntr(1) Mrk 2, 1 ShowScaffold 1 'erases scaffold for previous pose END IF

Drawling 2 WEND
WHILE DrawCPoseOK = False CLS
LINE (10, 29)-(630, 340), 5, B
IF Scaffold = True THEN
MrkScaffoldCntr "Mark Scaffold Center For C Pose", 1, 3 ShowScaffold 3 ShowScaffold 2 XYZ = CScaffoldCntr(1) Mrk 2, 1 END IF
Drawling 3 WEND
WHILE DrawDPoseOK = False CLS
LINE (10, 29)-(630, 340), 5, B
IF Scaffold = True THEN
MrkScaffoldCntr "Mark Scaffold Center For D Pose", 1, 4 ShowScaffold 4 Showscaffold 3 XYZ = DScaffoldCntr(1) Mrk 2, 1 END IF
Drawling 4 WEND
IF DrawAPoseOK = True AND DrawBPoseOK = True AND
DrawCPoseOK = True AND DrawDPoseOK = True THEN ImOK = True SELECT CASE UserChoice("", " , " , "poses OK", "RedoPoses", "") Operation = 2 END SELECT
END SUB
SUB Drawling (WchPose) WchPoseForMag = WchPose STATIC LinesTODraw DIM GuideBOx AS t3DPoint DIM OIdXYZ AS t3DPoint LINE (10, 29)-(630, 340), 5, B
IF LinkingToPreviousRun = True OR ReUsingPoseAOnly = True THEN
LinesToDraw = NoOfLines SetA RawPtsXPg, 0, 0: LnNo = 0: SetA TempPtsXPg, 0, 0 IF DeleteAllButPreviouslmage = True THEN
SELECT CASE WchPose CASE 3: DrawArray APtsXPg, 0, True IF ShowingScaffold = True THEN ShowScaffold 1 CASE 4: DrawArray APtsXPg, 0, True: DrawArray BPtsXPg, 0, True IF ShowingScaffold = True THEN ShowScaffold 2 END SELECT
END IF
PutDrwMnuOnScrn Text, WchPOSe, 0 FrstLn = False: Drawing = False: ImOK = False LineStartMarked = False IF WchPose = 1 AND LnNo = 0 THEN
LOCATE 2, 50:
IF LinkingTOPreviousRun = False THEN
PRINT "Line Color:"; LineColor ELSE

PRINT "Line Color:"; ALns(LnNo).LineCol END IF
END IF
IF WchPose = 1 THEN LOCATE 2, 65: PRINT "Lines Avl:"; 75 - LnNo WchPOSeForHili = WchPose ShowGuideLn WchPose DO
WndIn ShowCrsr IF XYZDiff THEN
IF INP(889) < 128 AND WchPose > 1 AND LinesToDraw > 0 AND
LnNo = LinesToDraw THEN
LOCATE 2, 1 PRINT "Last Line Already Done"
MyDelay 1 LOCATE 2, 1 PRINT SPACE$(30) GOTO REDOLINEOK
END IF
IF INP(889) < 128 THEN
IF LineStartMarked = False THEN
GuideBox = XYZ
Mrk 1, 1 LineStartMarked = True ZStartPt! = XYZ.Z
END IF
Draw3DPoint XYZ, -1 ZEndPt! = XYZ.Z
IF GlueLoops = True THEN
IF Index > 1 THEN
ZDisp = ZEndPt! - ZStartPt!
AbsZDisp = CINT(ABS(ZEndPt! - ZStartPt!)) END IF
IF AbsZDisp > 3 THEN SOUND 30 * AbsZDisp, 1 END IF
FrstLn = True 'firstline needed to prevent accidental exit when no line is there IF Drawing = False THEN
Drawing = True Index = 0 EI~ IF
Index = Index + 1 IF XYZ.x <> 0 AND XYZ.y <> 0 THEN EnterRawPt Index END IF
IF INP ( 889 ) >= 128 AND Drawing = True TfIEN
XYZ = GuideBox Mrk 1, 1 LineStartMarked = False Drawing = False Smooth RawPtsXPg, TempPtsXPg, 3, True --------------- check loop closure----------------------IF WchPose = 1 AND (MkLineLoop$ _ "CnfirmEach" OR
MkLineLoop$ _ "Automatic") THIN

IF LnEndsClose(TempPtsXPg, 1, GetA(TempPtsXPg, 0), 10) TFIENN
SELECT CASE MkLineLoop$
CASE "CnfirmEach"
IF Confirm("Glue Ends?") TF~N
IF GetA(TempPtsXPg, 0) > 30 Tf~N
S~noothJoin TempPtsXPg, 30 ELSE
LOCATE 6, 1 PRINT "Too Small To SmoothJoin"

LOCATE 6, 1 PRINT SPACE$(75) ENDIF
LOCATE 2, 30: PRINT "Glued "
MyDelay 1 IpCATE 2, 30: PRINT SPACE$(20) ALns(LnNo + 1).Looped = 1 END IF
CASE "Automatic"
IF GetA(TempPtsXPg, 0) > 30 Tf~N
SmoothJoin TempPtsXPg, 30 ELSE
LOCATE 6, 1 PRINT "TOO Small To SmoothJoin"

LOCATE 6, 1 PRINT SPACE$ (75) ENDIF
LOCATE 2, 30: PRINT "Glued "
MyDelay 1 LOCATE 2, 30: PRINT SPACE$(25) ALns(LnNo + 1).LOOped = 1 END SELECT
ELSE
BEEP
LOCATE 2, 30: PRINT "NOT A LOOP"

LOCATE 2, 30: PRINT SPACE$(25) END IF
DO UNTIL XYZ.y > 15 Wndln IpOP
END IF
IF WchPose > 1 AND ALns(LnNo + 1).Looped = 1 TI~1 IF LnEndsClose(TempPtsXPg, 1, GetA(TempPtsXPg, 0), 10) TI~I
LOCATE 2, 30: PRINT "Glued ": MyDelay 1 IF GetA(TempPtsXPg, 0) > 30 TI-~I SmoothJOin TempPtsXPg, 30 LOCATE 2, 30: PRINT SPACE$(25) ELSE
BEEP: BEEP
LOCATE 2, 28 PRINT "NO LOOP CLOSURE, YOU MUST DELETE AND REDO"

LOCATE 2, 28: PRINT SPACE$(65) END IF
END IF

---------------end check loop closure-----------------LINEENTRY:
LnNo = LnNo + 1 IF NozmalIm = False THEN ALns(LnNo).NoxmOrMag = 1 ELSE
ALns(LnNo).NormOrMag = 0 ALns(LnNo).StartVis = 1: ALns(LnNo).EndVis = NoOfFrames PutDrwMnuOnScrn Text, WchPose, 0 IF WchPose = 1 TF~T
ALns(LnNo).LineCol = LineColor LinesToDraw = LnNo MagLinesToDraw = LnNo NoOfLines = LnNo ALns(0).Beg = LnNo END IF
SELECT CASE WchPose CASE 1: LineLength(1, LnNo, 0) = GetA(TempPtsXPg, 0) CASE 2: LineLength(2, LnNo, 0) = GetA(TempPtsXPg, 0) CASE 3: LineLength(3, LnNo, 0) = GetA(TempPtsXPg, 0) CASE 4: LineLength(4, LnNo, 0) = GetA(TempPtsXPg, 0) END SELECT
IF WchPose > 1 AND LineLength(WchPose, LnNo, 0) <
LineLength(WchPose - 1, LnNo, 0) / 2 THEN
BEEP: LOCATE 2, 30: PRINT "LINE ENDED BY TRIGGER ERROR?"

LOCATE 20, 1: PRINT SPACE$(30) END IF
IF WchPose = 1 THEN
LOCATE 2, 65: PRINT "Lines Avl:"; 75 - LnNo LOCATE 2, 50: PRINT "Line Color:"; LineColor F~1D IF
IF WchPose > 1 THEN
IF LnNo = LinesToDraw THEN
PutDrwNl~2uOnScrn Text, WchPose, 1 ShowScaffold WchPose - 1 END IF
END IF
TrnsfrTmpTOImPartA WchPose 'transfers temppts to appropriate PtArray (Apts, BPts,etc.) 'and sets line info DrawArray RawPtsXPg, 0, False 'erases RawPts on Screen ShowLn WchPose, LnNo, -1 'shows line IF WchPose > 1 AND NOT ReUsingPrevLine THEN
ShowLn WchPose - 1, LnNo, 0 ReUsingPrevLine = False ShowGuideLn WchPose 'shows guideline on previous Pose (except for A Pose shows B Pose) END IF
END IF
REDOLINEOK:
IF XYZ.y < 15 THEN
WndSlct Ans$, 1 SELECT CASE Ans$
CASE A$
IF WChPose = 1 THEN

LOCATE 4, 1: PRINT SPACE$(35) LOCATE 4, 1: INPI7T "Line Name"; Name$:
ALns(LnNO).Label = UCASE$(Name$) LOCATE 4, 1: PRINT SPACE$(35) ELSE
ShowScaffold WchPose ShowScaffold WchPose - 1 END IF
CASE B$ '(choose line color in Pose 1; use prey line in all other Poses) IF WchPose = 1 THEN
ChooseLineColor PutDrwMnuOnScrn Text, WchPose, 0 LOCATE 2, 50: PRINT "Line Color:"; LineColor IF WchPOSe = 1 THEN
hOGATE 2, 65 PRINT "Lines Avl:"; 75 - LnNo END IF
END IF
IF WchPose > 1 AND LnNO < LinesToDraw THEN
ReUsingPrevLine = True IF WchPose = 2 THEN SourcePose = 1 'can only re-use line from Pose 1 IF WchPOSe > 2 THEN
Text$ _ "From Hlhat Pose?"
A$ _ "A": B$ _ "B..: C$ _ SELECT CASE WchPose WndChs Text, A$, B$, "x", "x", "x", Ans$, 0 WndChs Text, A$, B$, C$, "x", "x", Ans$. 0 END SELECT
SELECT CASE Ans$
CASE A$: SourcePOSe = 1 CASE B$: SourcePose = 2 CASE C$: SourcePOSe = 3 END SELECT
END IF
DestinationPose = WchPose TrnsfrPrevLineToIm SourcePose, DestinationPose, LnNO + 1 PutDrwMnuOnScrn "", WchPose, 0 'as if drawn by wand FrstLn = True 'when goes to LINEE«TRY
GOTO LINEEN'fRY:
END IF
CASE C$ '(finished) IF LnNo < LinesToDraw THEN
BEEP
LOCATE 5, 1: PRINT "Not Enough Lines"
MyDelay 1 hOCATE 5, 1: PRINT SPACE$(16) END IF
IF FrstLn = True AND LnNo = LinesToDraw THEN
FrstLn = False IF WchPOSe = 1 THEN DrawAPoseOK = True IF WchPOSe = 2 THEN DrawBPoseOK = True IF WchPose = 3 THEN DrawCPoseOK = True IF WchPose = 4 TF~N DrawDPoseOK = True END IF
CASE D$ '(delete last line) IF (Normallm = True AND ALns(LnNo).NormOrMag = 0) OR
(NormalIm = False AND ALns(LnNo).NormOrMag = 1) TF~N
IF LnNo > 0 TF~N DelLast WchPose IF LnNo = 0 TF~N FrstLn = False IF WchPose = 1 Tf~N
ALns(LnNo + 1).LOOped = 0 LinesToDraw = LinesToDraw - 1 MagLinesToDraw = LinesToDraw END IF
LOCATE 2, 60: PRINT "Lines Avl:"; 75 - LnNo PutDrwMnuOnScrn "", WchPOSe, 0 ShowGuideLn wchPose ELSE
LOCATE 7, 1: PRINT "Can't Delete A Line Drawn In A
Different Magnification"

LOCATE 7, 1: PRINT SPACE$(75) END IF
CASE E$ '(in Pose 1 this is intermittent line; in all others is repeat whole of A Pose for all remaining Poses) IF WchPOSe = 1 TFIEN
PRINT "will be intermittent"
Intermittent = True ELSE
SELECT CASE WchPose TrnsfrATo BPtsXPg, BLns() DrawBPoseOK = True TrnsfrATo CPtsXPg, CLns() DrawCPoseOK = True TrnsfrATo DPtsXPg, DLns() DrawDPoseOK = True AllPosesSameASA = True TrnsfrATo CPtsXPg, CLns() DrawCPoseOK = True TrnsfrATo DPtsXPg, DLns() DrawDPoseOK = True TrnsfrATo DPtsXPg, DLns() DrawDPoseOK = True END SELECT
RepeatA = True END IF
END SELECT
END IF
IF (WchPose = 1 AND DrawAPoseOK = True) OR
(WchPose = Z AND DrawBPoseOK = True) OR
(WchPose = 3 AND DrawCPoseOK = True) OR
(WchPose = 4 AND DrawDPoseOK = True) TII~N EXIT DO
LOOP
END SUB
SUB DrawPartialArray (aArray, aStart, aFinish, aColor, aUseLines) DIM Ptl AS t3DPOint, Pt2 AS t3DPOint IF aFinish > aStart TF~N

GetArrayReal aArray + 0, aStart, Ptl.x GetArrayReal aArray + 1, aStart, Ptl.y GetArrayReal aArray + 2, aStart, Ptl.Z
Draw3DPoint Ptl, aColor FOR I = aStart + 1 TO aFinish GetArrayReal aArray + 0, I, Pt2.x GetArrayReal aArray + 1, I, Pt2.y GetArrayReal aArray + 2, I, Pt2.Z
IF Pt2.x = 0 THEN
IACATE 5, 1: PRINT "You have drawn a line in which the value of one point or more is zero"
SLEEP 2: LOCATE 5, 1: PRINT SPACE$(79) END IF
IF aUseLines = True THEN
Draw3DLine Ptl, Pt2, aColor Ptl = Pt2 ELSE
Draw3DPoint Pt2, aColor END IF
NEXT
END IF
END SUB
SUB Drav~VVelGraph (aDrawnPath, aFramePosArray) CLS
DrawArray aDrawnPath, -1, True FOR I = 1 TO GetA(aFramePosArray, 0) XYZ.x = GetAReal!(aFramePosArray + 0, I) XYZ.y = GetAReal!(aFramePOSArray + 1, I) XYZ.Z = GetAReal!(aFramePOSArray + 2, I) Mrk 0, 1 NEXT
LINE (0, 20)-(639, 20), 15 LINE (0, 320)-(639, 320), 15 LOCATE 3, 1: PRINT "FAST"
LOCATE 23, 1: PRINT "STATIC"
TextPos = 5 TextLineColor = 1 FOR I = 1 TO NoOfSortedSyncPts TextLineColor = TextLineColor + 1 IF TextLineColor = 4 THEN TextLineColor = 5 IF TextLineColor = 7 THEN TextLineColor = 15 IF TextLineColor = 9 THEN TextLineColor = 10 IF TextLineColor = 16 THEN TextLineColor = 1 x = 40 + (SortedSyncPts(I).Frame - 1) * Interval!
LINE (x, 20)-(x, 320), TextLineColor LOCATE I + 3, 1 IF I > 1 AND I < NoOfSortedSyncPts THEN
COLOR TextLineColor: PRINT SortedSyncPts(I).Label: COLOR 5 END IF
NEXT
FOR Frame = 1 TO NoOfFrames XPos = 40 + (Frame - 1) * Interval!
LINE (XPos, 320)-(XPos, 325), 7 CIRCLE (XPos, 320 - 2 * FrmToFrmVelocity!(Frame)), 3, 15 NEXT
END SUB
SUB EnterRawPt (PtIndex) SetArrayReal RawPtsXPg, PtIndex, XYZ.x SetArrayReal RawPtsXPg + 1, PtIndex, XYZ.y SetArrayReal RawPtsXPg + 2, PtIndex, XYZ.Z
SetA RawPtsXPg, 0, PtIndex END SUB
SUB ErsMnu LINE (0, 0)-(639, 28), 0, BF
END SUB
FUNCTION FindAln (aMatchPt, aPOintNdx) ' Returns an index into the line table I = 0 DO: I = I + 1 LOOP UNTIL I
> NoOfLines OR (aPointNdx >= ALns(I).Beg AND

aPointNdx <= ALns(I).Fin) IF I <= NoOfLines TIN

FindAln = I

MtchPts(aMatchPt,= ALns(I).WchGrp 5) MtchPts(aMatchPt,= ALns(I).WchObj 6) MtchPts(aMatchPt,= I
7) ELSE

FindAln = -1 END IF

END FUNCTION

FUNCTION FindAlnFOrIntermit (WchPt) I = 0 DO: I = I + 1 LOOP UNTIL I > NoOfLines OR (WChPt >= ALns(I).Beg AND
WchPt <= ALns(I).Fin) IF I <= NoOfLines THEN
FindAlnForIntermit = I
FindAlnForIntermit = -1 END IF
END FUNCTION
SUB FindDesPt (WchPose, WchLine) Range = 0 FoundIt = False DD
Range = Range + 1 SELECT CASE WchPose GetStartFinish ALns(), WchLine, Start, Finish FindInRng APtsXPg, Start, Finish, Range GetStartFinish BLns(), WchLine, Start, Finish FindInRng BPtsXPg, Start, Finish, Range GetStartFinish CLns(), WchLine, Start, Finish FindInRng CPtsXPg, Start, Finish, Range GetStartFinish DLns(), wchLine, Start, Finish FindInRng DPtsXPg, Start, Finish, Range END SELECT
LOOP UNTIL FoundIt OR (Range > 10) IF ThisOne < Start + 10 OR ThisOne > Finish - 10 THEN
BEEP: BEEP:
FoundIt = False END IF
IF FoundIt = False THEN
LOCATE 3, 1 PRINT "Not Found Or Too Close To Start Or End Of A Line"
ST.F'FP 1 LOCATE 3, 1: PRINT SPACE$(70) END IF
END SUB
SUB FindFrmInChartObjGrpWarp (Kind, WchOne, WchFrame) DO
Wndln CalcFlatXY
ShowFlatCrsr FrameNo = CINT((XYZ.x - 40) / Interval! + 1) IF FrameNo > 0 AND FrameNo <= NoOfFrames THEN
LOCATE 2, 30: PRINT "Frame"; FrameNo DistFromPrev = FrameNo - syncpts(SyncPtIndex).Frame LOCATE 3, 1: PRINT "Distance From Previous SyncPt"; DistFro~mPrev IF INP(889) < 128 THEN
FoundIt = True WchFrame = FrameNo EXIT DO
END IF
ELSE
LOCATE 2, 30: PRINT SPACE$(15) LOCATE 3, 1: PRINT SPACE$(65) END IF
IAOP
END SUB
SUB FindInApts (FoundPt) Range = 0 FoundIt = False DO
Range = Range + 1 FindInRng APtsXPg, 1, GetA(APtsXPg, 0), Range LOOP UNTIL FoundIt OR (Range > 10) IF FoundIt = True THEN FoundPt = ThisOne IF FoundIt = False THEN
LOCATE 3, 1: PRINT "Not Found": SLEEP 1 LOCATE 3, 1: PRINT SPACE$(10) END IF
END SUB
SUB FindInRng (PtArray, Start, Finish, Range) FoundIt = False I = Start DO
I = I + 1 IF I > Finish THEN EXIT DO
TrialX = GetAReal!(PtArray, I) TrialY = GetAReal!(PtArray + 1, I) TrialZ = GetAReal!(PtArray + 2, I) IF TrialX < XYZ.x + Range AND TrialX > XYZ.x - Range AND
TrialY < XYZ.y + Range AND TrialY > XYZ.y - Range AND

TrialZ < XYZ.Z + Range * 4 AND TrialZ > XY2.Z - Range * 4 THEN
FoundIt = True EXIT DO
END IF
LOOP
IF Foundlt = True THEN
ThisOne = I
XYZ.x = TrialX: XYZ.y = TrialY: XYZ.Z = TrialZ
FoundPt = XYZ
END IF
END SUB
SUB FindLngstSeg SumSegLen = 0 FOR I = 1 TO NoOfSegs SegLen(1) _ (TempSegs(I).AEndPt - TempSegs(I).AStartPt) + 1 SegLen(2) _ (TempSegs(I).BEndPt - TempSegs(I).BStartPt) + 1 SegLen(3) _ (Te~Segs(I).CEndPt - TempSegs(I).CStartPt) + 1 SegLen(4) _ (TempSegs(I).DEndPt - TempSegs(I).DStartPt) + 1 BestLenSoFar = 0 FOR s = 1 TO 4 IF SegLen(s) > BestLenSoFar THEN
BestLenSoFar = SegLen(s) Longest = s END IF
NEXT
LongestSeg(I, 0) = Longest 'the val of the 0 posit is the Pose in which seg(i) is the longest LongestSeg(I, 1) = SegLen(Longest) 'the val of the 1 posit is the length SumSegLen = SumSegLen + BestLenSoFar 'total length of Begs after justification NEXT
END SUB
SUB FindMrkdPtInAPose (ThisOne, Text) LOCATE 2, 1: PRINT Text$
FoundIt = False WHILE FoundIt = False GetWndXYZ 0 FindInApts ThisOne WEND
GetXYZ ThisOne Mrk 1, 1 MyDelay 1 LOCATE 1, 1: PRINT SPACE$(35) END SUB
FUNCTION FindWchFinlSg (Array() AS FinlSgType, PointNdx) I = 0 DO: I = I + 1 LOOP UNTIL I > NoOfSegs OR (PointNdx >= Array(I).Beg AND
PointNdx c= Array(I).Fin) IF I <= NoOfSegs THEN
FindWchFinlSg = I
ELSE
FindWchFinlSg = -1 END IF
END FUNCTION

FUNCTION GetA (PageNo, Index) GetArray PageNo, Index, Value GetA = Value END FUNCTION
FUNCTION GetAReal! (PageNO. Index) GetArrayReal PageNo, Index, Value!
GetAReal = Value!
END FUNCTION
SUB GetImFxXYZ (ImToFix, PtPOSit) XYZ.x = GetAReal!(APtsXPg + 3 * (ImToFix - 1), PtPosit) XYZ.y = GetAReal!(APtsYPg + 3 * (ImToFix - 1), PtPosit) XYZ.Z = GetAReal!(APtsZPg + 3 * (ImToFix - 1), PtPosit) END SUB
SUB GetPts (PtArray, PtArrayNdx) XYZ.x = GetAReal!(PtArray, PtArrayNdx) XYZ.y = GetAReal!(PtArray + 1, PtArrayNdx) XYZ.Z = GetAReal!(PtArray + 2, PtArrayNdx) EI~ SUB
SUB GetStartFinish (LnLst() AS Line Type, LnNo, Start, Finish) Start = LnLSt(LnNo).Beg Finish = LnLst(LnNo).Fin END SUB
SUB GetSumWarpDisp (SegInfoLst(), SegInfLstIndx, FrameNo, SegNO, SegPtNo, SumWarpDisp AS t3DPoint) DIM WarpSegPathPtPosit AS t3DPoint DIM HndlPathDiff AS t3DPOint DIM WarpSegWaveDisp AS t3DPoint SumWarpDisp.x = 0: SumWarpDisp.y = 0: SumWarpDisp.Z = 0 FOR I = 1 TO SegInfLstIndx m = SegInfoLst(I) '******* where in warp path if inertia or wind warp:
IF SegInfo(m).Kind = "Iner" OR SegInfo(m).Kind = "Wind" TF~N
AdjFrameNo = FrameNo - 5 IF AdjFrameNo < 1 THENN AdjFrameNo = 1 'this delays warp so it feels like an effect of movement WarpSegPathArrayPositPtr AdjFrameNo, SegInfo(m).WchPath, WarpSegPathPtPosit END IF
IF SegInfo(m).Kind = "Time" TIiEN
WarpSegPathArrayPositPtr FrameNo, SegInfo(m).WchPath, WazpSegPathPtPosit END IF
'******** wave position along segment:
'(length of seg is in SegInfo(m).SegLen) SELECT CASE SegInfo(m).WchWave LenOfWave = GetA(JAPtsXPg, 0) LenOfWave = GetA(JBPtsXPg, 0) LenOfWave = GetA(JCPtsXPg, 0) LenOfWave = GetA(JDPtsXPg, 0) END SELECT
IF SegInfo(m).Kind = 'Wave" THEN
SELECT CASE SegInfo(m).OverLap CASE 0 'ol at start of at end LM = SegInfo(m).SegLen Increment = (LM / NoOfFrames * WaveSpeed) * FrameNo SELECT CASE SegInfo(m).Direc CASE "HtoT"
PositionNo = SegPtNo + LenOfWave / 2 - Increment CASE "TtoH"
PositionNo = SegPtNO + Increment END SELECT
~E 1 'ol at start no of at end LM = SegInfo(m).SegLen Incr~nent = (LM / NoOfFrames * WaveSpeed) * FrameNo SELECT CASE SegInfo(m).Direc CASE "HtoT"
PositionNo = SegPtNo - Increment CASE "TtoH"
PositionNo = SegPtNO + Increment END SELECT
CASE 2 'no of at start of at end LM = SegInfo(m).SegLen Increment = (LM / NoOfFrames * WaveSpeed) * FrameNo SELECT CASE SegInfo(m).Direc CASE "HtoT"
PositionNo = SegPtNo + LenOfWave - Increment CASE "TtoH"
PositionNo = SegPtNo + Increment END SELECT
CASE 3 'no of at start no of at end LM = 2 * SegInfo(m).SegLen Increment = (LM / NoOfFrames * WaveSpeed) * FrameNo SELECT CASE SegInfo(m).Direc CASE "HtoT"
PositionNo = SegPtNo + LenOfWave - Increment CASE "TtoH"
PositionNo = SegPtNO + Increment END SELECT
END SELECT
EndOfWave = LenOfWave IF PositionNo > LenOfWave THEN PositionNo = LenOfWave 'end of wave array IF PositionNo < 1 THEN PositionNo = 1 WarpSegWaveShapePtr PositionNo, SegInfo(m).WchWave, WarpSegWaveDisp END IF
'****** where along the warp profile is this image (segment) point?:
'Prop! is how much the point will be affected by the 'displacement between the warp handle and the position on the warp path WhereInProf = SegPtNO + Seglnfo(m).ProfBeg - 1 Prop! = WarpSegProfPtr(SegInfo(m).WchProf, WhereInProf) '****** get the displacement for this warp:
IF SegInfo(m).Kind = "Time" OR SegInfo(m).Kind = "Iner" OR
SegInfo(m).Kind = "Wind" THEN
HndlPathDiff.x = WarpSegPathPtPosit.x -GetAReal!(APtsXPg, SegInfo(m).Hndl) HndlPathDiff.y = WaxpSegPathPtPosit.y -GetAReal!(APtsYPg, SegInfo(m).Hndl) HndlPathDiff.Z = WarpSegPathPtPosit.Z -GetAReal!(APtsZPg, SegInfo(m).Hndl) WarpSegDisp.x = (HndlPathDiff.x * Prop!) WarpSegDisp.y = (HndlPathDiff.y * Prop!) WarpSegDisp.Z = (HndlPathDiff.Z * Prop!) END IF
IF SegInfo(m).Kind = "Wave" TF~NN
WarpSegDisp.x = (WarpSegWaveDisp.x * Prop!) WarpSegDisp.y = (WarpSegWaveDisp.y * Prop!) WarpSegDisp.Z = (WarpSegWaveDisp.Z * Prop!) END IF
'******: add it to any other warps) if any:
SumWarpDisp.x = SumWarpDisp.x + WarpSegDisp.x SumWarpDisp.y = SumWarpDisp.y + WarpSegDisp.y SumWarpDisp.Z = SumWarpDisp.Z + WarpSegDisp.Z
NEXT
END SUB
SUB GetVelGraphFromPath (aArray) PtsPerFra~! _ (GetA(aArray, 0) - 1) / (NoOfFrames - 1) FOR Frame = 2 TO NoOfFrames StartPt! _ (Frame - 2) * PtsPerFrame! + 1 EndPt! = StartPt! + PtsPerFrame!
IF TNT(StartPt!) = INT(EndPt!) THEN
FrmToFzmVelocity!(Frame) = DistToNextPOint(aArray, INT(StartPt!)) * (EndPt! - StartPt!) ELSE
Sump! = DistToNextPoint(aArray, 7.Nr(StartPt!)) (INT(StartPt!) + 1 - StartPt!) FOR I = INf(StartPt!) + 1 TO INT(EndPt!) - 1 Sump! = Sump! + DistToNextPoint(aArray, I) NEXT
IF INT(EndPt!) <> EndPt! TIN
Sump! = Sump! + DistToNextPoint(aArray, INT(EndPt!)) (EndPt! - INT(EndPt!)) END IF
FrmToFrmVelocity!(Frame) = Sump!
END IF
NEXT
END SUB
SUB GetVelGraphFromUser (aDrawnPath) LOCATE 1, 1: PRINT "Redraw Velocity Graph"
' ******************************* Wait for button down WHILE INP(889) >= 128 WndIn IF XYZDiff THEN ShowFlatCrsr WEND
FOR I = 1 TO 1000: NEXT 'Short Delay for Button Bounce ******************************* Draw velocity CilrVe Index = 0 WHILE INP(889) < 128 WndIn IF XYZDiff THEN
ShowFlatCrsr PSET (XYZ.x, XYZ.y), 15 Index = Index + 1 EnterRawPt Index END IF
WEND
******************************* COriVert Curve t0 VelOC7.tleS
FrmToFrmVelocity!(1) = 0 J = 2 FOR Frame = 2 TO NoOfFrames WHILE (GetAReal!(RawPtsXPg, J) < 40 + (Frame - 1) * Interval!) AND
(J < GetA(RawPtsXPg, 0)) J = J + 1 WEND
dx! = GetAReal!(RawPtsXPg, J) - GetAReal!(RawPtsXPg, J - 1) IF dx! = 0 THEN dx! _ .O1 DY! = GetAReal!(RawPtsYPg, J) - GetAReal!(RawPtsYPg, J - 1) Vel! = 320 - (GetAReal!(RawPtsYPg, J - 1) + DY! * (40 + (Frame - 1)*
Interval! - GetAReal!(RawPtsXPg, J - 1)) / dx!) ' Vel is PrevY + DY * (X - PrevX) / DX
FrmToFrmVelocity!(Frame) = Limits(Vel!, 0!, 275!) CIRCLE (40+(Frame-1)*Interval!, 320-FrmToFrmVelocity!(Frame)),3,14 NEXT
********************* Adjust eels for total length and syncPoints FOR Segment = 1 TO NoOfSortedSyncPts - 1 SegLength! = 0 TotalSegVels! = 0 FOR PtNo = SortedS~rnCPts(Segment).TempPtsIndex TO
SortedSyncPts(Segment + 1).TempPtsIndex - 1 SegLength! = SegLength! + DistToNextPoint!(aDrawnPath, PtNo) NEXT
FOR Frame = SortedSyncPts(Segment).Frame + 1 TO
SortedSyncPts(Segment + 1). Frame TotalSegVels! = TotalSegVels! + FrmToFrmVelocity!(Frame) NEXT
FOR Frame = SortedSyncPts(Segment).Frame + 1 TO
SortedSyncPts(Segment + 1). Frame IF TotalSegVels! = 0 THEN
FrmTOFrmVelocity!(Frame) = 0 ELSE
FrmTOFrmVelocity!(Frame) _ FrmToFrmVelocity!(Frame) * SegLength! / TotalSegVels!
END IF
NEXT
NEXT
END SUB
SUB GetWarpProfile (WarpNo) ' ******************************* Display layout on screen cLs LOCATE 1, 1: PRINT "Draw Profile of Desired Warp Along Selected Segments(s)"
LOCATE 3, 1: PRINT "Full Warp Effect"
LOCATE 23, 1: PRINT "No Warp Effect"
LINE (0, 42)-(639, 42), 6 LINE (0, 308)-(639, 308), 6 LINE (30, 42)-(30, 308), 15 TotalSegsLen = 0 FOR I = I TO NoInSrs TotalSegsLen = TotalSegsLen + WarpSrs(I, 0) NEXT' PointInterval! = 600! / (TotalSegsLen - 1) FOR I = 0 TO TotalSegsLen - 1 LINE (30+I*PointInterval!,305)-(30+I*PointInterval!,307), 15 NEXT
Length = 0 FOR I = 1 TO NoInSrs Length = WarpSrs(I, 0) + Length POSIT = CINT((Length - 1) * PointInterval!) LINE (30 + POSIT, 42)-(30 + POSIT, 308), 10 NEXT
LINE (30 + POSIT, 42)-(30 + POSIT, 308), 15 ************************* Show a-Pose of segments being warped FOR J = 1 TO NoOfSegs IF FinlSgs(J).WarpNo = WarpNo THEN
DrawPartia7.Array APtsXPg, FinlSgs(J).Beg, FinlSgs(J).Fin, -1, False ShowASegStart J
END IF
NEXT
' ******************************* Wait for button down WHILE INP(889) >= 128 WndIn IF XYZDiff THEN ShowFlatCrsr WEND
FOR I = 1 TO 1000: NEXT 'Short Delay for Button Bounce ******************************* ~aW Warp prOflle Index = 0 WHILE INP(889) < 128 WndIn IF XYZDiff THEN
ShowFlatCrsr PSET (XYZ.x, XYZ.y), 15 Index = Index + 1 EnterRawPt Index END IF
WEND
' ******************************* STiIOOth and redraw Smooth RawPtsXPg, Te~PtsXPg, 3, True FOR I = 1 TO GetA(RawPtsXPg, 0) ShowFlatPt GetAReal!(RawPtsXPg, I), GetAReal!(RawPtsYPg, I), 13 ShowFlatPt GetAReal!(TempPtsXPg, I), GetAReal!(Tettg~PtsYPg, I), 15 NEXT
' ******************************* Convert to proportions J = 2 FOR PtNo = 1 TO TotalSegsLen WHILE (GetAReal!(TempPtsXPg, J) < 30 + (PtNo - 1) * Pointlnterval!) AND (J < GetA(TempPtsXPg, 0)) J = J + 1 WEND
dx! = GetAReal!(TempPtsXPg, J) - GetAReal!(TempPtsXPg, J - 1) IF dx! = 0 THEN dx! _ .O1 DY! = GetAReal!(TempPtsYPg, J) - GetAReal!(TempPtsYPg, J - 1) Prop! _ (308-(GetAReal!(TempPtsYPg, J-1) +
DY! * (30+(PtNo-1)*POintInterval!-GetAReal!(TempPtsXPg, J-1)) / dx!)) / 267!
' Prop is PrevY + DY * (X - PrevX) / DX
Prop! = Limits(Prop!, 0!, 1!) SetArrayReal RawPtsXPg, PtNo, Prop!
CIRCLE (30 + (PtNo - 1) * PointInterval!, 308 - Prop! * 267), 3, 14 NEXT
END SUB
SUB GetWndXYZ (Kind) FoundIt = False DO
WndIn ShowCrsr IF INP(889) < 128 THEN
Wx = XYZ.x: Wy = XYZ.y: Wz = XYZ.Z
EXIT DO
END IF
IF Kind = 1 THEN
FOR I = 1 TO NoOfFrames J = Spacer * I + 30 IF XYZ.x = J THEN LOCATE 2, 30: PRINT "Frame"~ I
NEXT
END IF
LOOP
END SUB
SUB GetXYZ (WchPt) XYZ.x = GetAReal!(APtsXPg, WchPt) XYZ.y = GetAReal!(APtsYPg, WchPt) XYZ.Z = GetAReal!(APtsZPg, WchPt) END SUB
SUB HiLiFinlSg (SegNo) IF ChoiceInSegHili = True THEN
B$ _ "Confirm": C$ _ "Reject"
WndChs " " ~ ..x.. ~ g$, C$, "x" , ,~x.. ~ Ans$, 1 END IF
Start = FinlSgs(SegNo).Beg Finish = FinlSgs(SegNO).Fin DO WHILE XYZ.y > 15 XYZ.x = GetAReal!(APtsXPg, Start) XYZ.y = GetAReal!(APtsYPg, Start) XYZ.Z = GetAReal!(APtsZPg, Start) Mrk 3, 1 counter = 0 DO WHILE counter < 20000 counter = counter + 1 LOOP
Mrk 3, 1 FOR I = Start TO Finish - 3 STEP 2 FOR J = I TO I + 3 WndIn IF XYZ.y < 15 THEN EXIT DO
ShowCrsr GetXYZ (J) Draw3DPoint XYZ, 0 IF INP(889) < 128 THEN EXIT DO
NEXT
FOR J = I TO I + 3 WndIn ShowCrsr GetXYZ (J) Draw3DPoint XYZ, -1 IF INP(889) < 128 THEN EXIT DO
NEXT
NEXT
LOOP
IF ChoiceInSegHili = True THIN
WndSlct Ans$, 1 ErsMnu END IF
ChoiceInSegHiIi = False END SUB
SUB HiLiLn (LnArray() AS LineType, PtArray, LnNo) DIM Pt1 AS t3DPOint, Pt2 AS t3DPOint IF WchPoseForHili > 1 AND LnNo < ALns(0).Beg + 1 THEN
GetStartFinish LnArray(), LnNo, Start, Finish Done = False IF Finish > Start + 5 THEN
WHILE NOT Done GetPts PtArray, Start 'puts values into XYZ
Mrk 3, 1 counter = 0 DO WHILE counter < 30000 counter = counter + 1 IAOP
Mrk 3, 1 FOR I = Start TO Finish - 1 GetArrayReal PtArray + 0, I, Ptl.x GetArrayReal PtArray + 1, I, Ptl.y GetArrayReal PtArray + 2, I, Ptl.Z
GetArrayReal PtArray + 0, I + 1, Pt2.x GetArrayReal PtArray + 1, I + 1, Pt2.y GetArrayReal PtArray + 2, I + 1, Pt2.Z
Draw3DLine Ptl, Pt2, 0 Delay = 0 Done = (INP(889) < 128) WHILE Delay < 2 AND NOT EarlyExit Wndln Done = ((INP(889) < 128) OR (XYZ.y < 15)) ShowCrsr Delay = Delay + 1 WEND
Draw3DLine Ptl, Pt2, -1 IF Dorie THEN EXIT FOR
NEXT
WEND
END IF
END IF
END SUB
SUB IdentGroups WchPoseForHili = 2 LastGrp = 0 WHILE GroupsDefnd = False FOR I = 1 TO ALns(O).Beg A$ _ "1": B$ _ "2": C$ _ "3": D$ _ "4": E$ _ "5"
WndChs "ASSIGN INDICATED LINE TO A GROUP", A$, B$, C$, D$, E$, Ans$, 1 HiLiLn ALns(), APtsXPg, I
WndSlct Ans$, 1 WchGrp = VAL(Ans$) IF WchGrp > LastGrp + 1 THEN
BEEP: LOCATE 3, 1 PRINT "Can't Skip A Number; Assign Group Again (Last Assignment Was To Group"; LastGrp; ")"

LOCATE 3, 1: PRINT SPACE$(40) I = I - 1 CLS
ELSE
PutInGrp I, WchGrp LastGrp = WchGrp END IF
NEXT
RedoGroupsOK:
SELECT CASE UserChoice("", " , "", "Groups OK", "Redo", "") GroupsDefnd = True FOR I = 1 TO NoOfGroups ALns(I).WchGrp = 0 BLns(I).WchGrp = 0 CLns(I).WchGrp = 0 DLns(I).WchGrp = 0 NEXT
NoOfGroups = 0 CASE ELSE
GO'I'O RedoGroupsOK
END SELECT
WEND
END SUB
SUB IdentObjects LastObj = 0 WHILE ObjectsDefnd = False FOR I = 1 TO NoOfGroups CLS
FOR J = 1 TO NoOfLines IF ALns(J).WchGrp = I THEN ShowLn 1, J, -1 NEXT
F$ _ "ASSIGN ": G$ = Group(I).Label: H$ _ " TO AN OBJECT"
J$ = F$ + G$ + H$
WchObj = UserChoice(J$, "1", "2", "3", "", "") IF WchObj > LastObj + 1 TF~N
BEEP: LOCATE 3, 1 PRINT "Can't Skip A Number; Assign Object Again (Last Assignment Was To Object"; LastObj; ")"

LOCATE 3, 1: PRINT SPACE$(40) I = I - 1 CLS
ELSE
PutInObj I, WchObj LastObj = WchObj END IF
NEXT
SELECT CASE UserChoice("", "", "", ~0bjects OK", "Redo~, ~") ObjectsDefnd = True FOR K = 1 TO NoOfObj ALns(K).WchObj = 0 BLns(K).WchObj = 0 CLns(K).WchObj = 0 DLns(K).WchObj = 0 Group(WchGrp).WchObj = 0 NEXT
NoOfObj = 0 END SELECT
WEND
END SUB
SUB Interpo (Array, StartOfGap, EndOfGap) 'this creates missing pts in gaps between 'two susequent values of array NoOfGaps = EndOfGap - StartOfGap ValDiff = GetAReal!(Array, EndOfGap) -GetAReal!(Array, StartOfGap) 'for x Incr! = ValDiff / NoOfGaps FOR I = StartOfGap - StartOfGap + 1 To EndOfGap - StartOfGap - 1 SetArrayReal Array, StartOfGap + I, GetAReal!(Array, StartOfGap) + (I * Incr!) NEXT
ValDiff = GetAReal!(Array + 1, EndOfGap) -GetAReal!(Array + 1, StartOfGap) 'for y Incr! = ValDiff / NoOfGaps FOR I = StartOfGap - StartOfGap + 1 TO EndOfGap - StartOfGap - 1 SetArrayReal Array + 1, StartOfGap + I, GetAReal!(Array + 1, StartOfGap) + (I * Incr!) NEXT
ValDiff = GetAReal!(Array + 2, EndOfGap) -GetAReal!(Array + 2, StartOfGap) 'for z Incr! = ValDiff / NoOfGaps FOR I = StartOfGap - StartOfGap + 1 TO EndOfGap - StartOfGap - 1 SetArrayReal Array + 2, StartOfGap + I, GetAReal!(Array + 2, StartOfGap) + (I * Incr!) NEXT
END SUB
SUB JstfyT~SegsPartA
SegStart = 1 FOR I = 1 TO NoOfSegs IF SegLen(1) <> 0 AND SegLen(2) <> 0 AND

SegLen(3) <> 0 AND SegLen(4) <> D TILT
SegEnd = SegStart + LongestSeg(I, 1) - 1 JstfyTempSegsPartB I, LongestSeg(I, 0), SegStart, SegEhd FinlSgs(I).Beg = SegStart FinlSgs(I).Fin = SegEnd SegStart = SegEnd + 1 END IF
FinlSgs(I).WchGrp = TempSegs(I).WChGrp FinlSgs(I).WchObj = TempSegs(I).WchObj FinlSgs(I).WChLine = TempSegs(I).WchLine NEXT
SetA JAPtsXPg, 0, SegEnd SetA JBPtsXPg, 0, SegEnd SetA JCPtsXPg, 0, SegEnd SetA JDPtsXPg, 0, SegEnd FOR I = 1 TO NoOfLines FOR J = 1 TO NoOfSegs IF FinlSgs(J).WchLine = I TF~N
ALns(I).FinalStart = FinlSgs(J).Beg EXIT FOR
END IF
NEXT
FOR J = 1 TO NoOfSegs IF FinlSgs(J).WchLine = I TFFIEN
ALns(I).FinalEnd = FinlSgs(J).Fin END IF
NEXT
ALns(I).Beg = ALns(I).FinalStart ALns(I).Fin = ALns(I).FinaIEnd BLns(I).Beg = ALns(I).FinalStart BLns(I).Fin = ALns(I).FinalEnd CLns(I).Beg = ALns(I).FinalStart CLns(I).Fin = ALns(I).FinalEnd DLns(I).Beg = ALns(I).FinalStart DLns(I).Fin = ALns(I).FinalEnd NEXT
END SUB
SUB JstfyTettg~SegsPartB (WchSeg, LngstSeg, SegStart, SegEnd) 'seg start,end, refers to Ien of the seg to which the 'others will be stretched I = WchSeg FOR J = SegStart TO SegEnd SELECT CASE LngstSeg CASE 1 'first transfer vals of longest seg from APts toJAPts K = (J - (SegStart - TempSegs(I).AStartPt)) SetArrayReal JAPtsXPg, J, GetAReal!(APtsXPg, K) SetArrayReal JAPtsYPg, J, GetAReal!(APtsYPg, K) SetArrayReal JAPtsZPg, J, GetAReal!(APtsZPg, K) K = (J - (SegStart - TempSegs(I).BStartPt)) SetArrayReal JBPtsXPg, J, GetAReal!(BPtsXPg, K) SetArrayReal JBPtsYPg, J, GetAReal!(BPtsYPg, K) SetArrayReal JBPtsZPg, J, GetAReal!(BPtsZPg, K) K = (J - (SegStart - TempSegs(I).CStartPt)) SetArrayReal JCPtsXPg, J, GetAReal!(CPtsXPg, K) SetArrayReal JCPtsYPg, J, GetAReal!(CPtsYPg, K) SetArrayReal JCPtsZPg, J, GetAReal!(CPtsZPg, K) K = (J - (SegStart - Te~Segs(I).DStartPt)) SetArrayReal JDPtsXPg, J, GetAReal!(DPtsXPg, K) SetArrayReal JDPtsYPg, J, GetAReal!(DPtsYPg, K) SetArrayReal JDPtsZPg, J, GetAReal!(DPtsZPg, K) END SELECT
NEXT
SELECT CASE LngstSeg Stretch BPtsXPg, JBPtsXPg, TempSegs(I).BStartPt, TempSegs(I).BEndPt, SegStart, SegEnd Stretch CPtsXPg, JCPtsXPg, TempSegs(I).CStartPt, TempSegs(I).CEndPt, SegStart, SegEnd Stretch DPtsXPg, JDPtsXPg, TeinpSegs(I).DStartPt, TempSegs(I).DEndPt, SegStart, SegEnd Stretch APtsXPg, JAPtsXPg, Te~Segs(I).AStartPt, TempSegs(I).AEndPt, SegStart, SegEnd Stretch CPtsXPg, JCPtsXPg, TempSegs(I).CStartPt, TempSegs(I).CEndPt, SegStart, SegEnd Stretch DPtsXPg, JDPtsXPg, TempSegs(I).DStartPt, TempSegs(I).DEndPt, SegStart, SegF~d Stretch BPtsXPg, JBPtsXPg, T~npSegs(I).BStartPt, TempSegs(I).BEndPt, SegStart, SegEnd Stretch APtsXPg, JAPtsXPg, TempSegs(I).AStartPt, TempSegs(I).AEndPt, SegStart, SegEnd Stretch DPtsXPg, JDPtsXPg, TempSegs(I).DStartPt, TempSegs(I).DEndPt, SegStart, SegEnd Stretch BPtsXPg, JBPtsXPg, TempSegs(I).BStartPt, TempSegs(I).BEndPt, SegStart, SegEnd Stretch APtsXPg, JAPtsXPg, TempSegs(I).AStartPt, TempSegs(I).AEndPt, SegStart, SegEnd Stretch CPtsXPg, JCPtsXPg, TempSegs(I).CStartPt, TempSegs(I).CEndPt, SegStart, SegEnd END SELECT
END SUB
S(Jg r.r7r.nr.,nrrays (WchPose, Col) IF WchPose = 1 THEN LdLnLst ALns(), WchPose, Col IF WchPose = 2 THEN LdLnLst BLns(), WchPose, Col IF WchPose = 3 THEN LdLnLst CLns(), WchPose, Col IF WchPose = 4 THEN LdLnLst DLns(), WchPose, Col END SUB
SUB LdLnLst (Array() AS LineType, WchPose, Col) Array(LnNo).Beg = Array(LnNo - 1).Fin + 1 Array(LnNo).Fin = GetA(APtsXPg + 3 * (WchPose - 1), 0) Array(0).Beg = LnNo END SUB
FUNCTION Limits! (x!, L!, H!) IF x! < L! THEN

Limits! = L!
ELSE
IF x! > H! THIN
Limits! = H!
ELSE
Limits! = x!
END IF
END IF
END FUNCTION
FUNCTION LnF~dsClose (PtArray, IndexPtA, IndexPtB, Range) LnEndsClose = GetAReal!(PtArray, IndexPtA) <
GetAReal!(PtArray, IndexPtB) + Range AND
GetAReal!(PtArray, IndexPtA) >
GetAReal!(PtArray, IndexPtB) - Range AND
GetAReal!(PtArray + 1, IndexPtA) <
GetAReal!(PtArray + 1, IndexPtB) + Range AND
GetAReal!(PtArray + 1, IndexPtA) >
GetAReal!(PtArray + 1, IndexPtB) - Range AND
GetAReal!(PtArray + 2, IndexPtA) <
GetAReal!(PtArray + 2, IndexPtB) + Range * 4 AND
GetAReal!(PtArray + 2, IndexPtA) >
GetAReal!(PtArray + 2, IndexPtB) - Range * 4 END FUNCTION
SUB MarkSpaceRefPts ShowSpaceRefPts STATIC I
Ans$ _ ""
DO UNTIL Ans$ = c$
I = I + 1 Text$ _ "If Wanted, Mark Reference Points In Space For Drawing Space Path Of " + Object(WchObj).Label DefnPt SpaceRef(I).Locat, Text, "MarkS~aceRefPts", 2 SpaceRef(0).Visib = I
LOOP
END SUB
SUB MkFrameScreenV4 (Kind, WchOne) SELECT CASE Kind Text$ _ "Object " + Object(WchOne).Label ColorCode = 2 Text$ _ "Group " + Group(WchOne).Label ColorCode = 3 Text$ _ "Warp " + Warp(WchOne).Label ColorCode = 4 END SELECT
CLS
LACATE 5, 1 PRINT Text$
YPos = 80 Height = 14 LINE (0, YPos)-(639, YPos), ColorCode LINE (0, YPOS + Height)-(639, YPos + Height), ColorCode LINE (0, YPos)-(39, YPos + Height), ColorCode, BF
FOR Frame = 1 TO NoOfFrames XPOS = 40 + Interval! * (Frame - 1) LINE (XPos, YPos)-(XPos, YPos + Height), ColorCode NEXT
END SUB
SUB MkMrkrs LINE (1, 8)-(4, 5), LCol LINE -(7, 8). LCol LINE (4, 8)-(4, 5), LCol GET (0, 0)-(9, 9), LCrsr LINE (1, 8)-(4, 5), RCol LINE -(7, 8), RCol LINE (4, 8)-(4, 5), RCol GET (0, 0)-(9, 9), RCrsr: CLS
CIRCLE (4, 4), 2, LCol: GET (0, 0)-(9, 9), CmrkL
CIRCLE (4, 4), 2, RCol: GET (0, 0)-(9, 9), CmrkR: CLS
LINE (0, 0)-(8, 8), LCol, B: GET (0. 0)-(9, 9), SqmrkL
LINE (0, 0)-(8, 8), RCol, B: GET (0, 0)-(9, 9), SqmrkR: CLS
LINE (0, 6)-(8, 6), LCol: LINE (0, 6)-(4, 1), LCol: LINE -(8, 6), LCol GET (0. 0)-(9. 9), TrmrkL
LINE (0, 6)-(8, 6), RCol: LINE (0, 6)-(4, 1). RCol: LINE -(8, 6), RCol GET (0, 0)-(9, 9), TrmrkR: CLS
LINE (0, 4)-(9, 4), LCol: LINE (4, 0)-(4, 9), LCol GET (0, 0)-(9, 9), CrossMrkL
LINE (0, 4)-(9, 4), RCol: LINE (4, 0)-(4, 9), RCol GET (0, 0)-(9, 9), CrossMrkR
END SUB
SUB MkPathCycle IF Confirm("Mk Cycle?") TF~N
IF GetA(TempPtsXPg, 0) > 30 THaT
DrawArray TempPtsXPg, 0, False SmoothJoin TempPtsXPg, 30 NoOfFrames = NoOfFrames - 1 LOCATE 3, 1: PRINT "Frames Reduced To'; NoOfFrames ELSE
LOCATE 3, 1: PRINT "Too Short"
END IF
END IF
DrawArray TempPtsXPg, -1, False END SUB
SUB MkScaffold IF Confirm("Mark Scaffold On <A> Source Pose For Reference inlhen Drawing Other Source Poses? ") TH'EN
MrkScaffoldGYitr "Mark Scaffold Center", 1, 1 Scaffold = True MrkScaffoldPts END IF
END SUB
SUB MkSegs DIM SegStarts(NoOfLines + NoOfMtchPts + 1) AS Tem~SegType FOR I = 1 TO NoOfLines SegStarts(I).AStartPt = ALns(I).Beg SegStarts(I).BStartPt = BLns(I).Beg SegStarts(I).CStartPt = CLns(I).Beg SegStarts(I).DStartPt = DLns(I).Beg SegStarts(I).WchGrp = ALns(I).WchGrp SegStarts(I).WchObj = ALns(I).WchObj NEXT
J = 0 IF NoOfMtchPts > 0 TF~1 FOR I = 1 TO NoOfMtchPts + 1 J = NoOfLines + I
SegStarts(J).AStartPt = MtchPts(I, 1) SegStarts(J).BStartPt = MtchPts(I, 2) SegStarts(J).CStartPt = MtchPts(I, 3) SegStarts(J).DStartPt = MtchPts(I, 4) SegStarts(J).WchGrp = MtchPts(I, 5) SegStarts(J).WchObj = MtchPts(I, 6) NoOfSegs = J - 1 NEXT
ELSE
NoOfSegs = NoOfLines END IF
FOR K = 1 TO NoOfSegs - 1 FOR I = 1 TO NoOfSegs - K
IF SegStarts(I).AStartPt > SegStarts(I + 1).AStartPt TI~1 SWAP SegStarts(I).AStartPt, SegStarts(I + 1).AStartPt SWAP SegStarts(I).BStartPt, SegStarts(I + 1).BStartPt SWAP SegStarts(I).CStartPt, SegStarts(I + 1).CStartPt SWAP SegStarts(I).DStartPt, SegStarts(I + 1).DStartPt SWAP SegStarts(I).WchGrp, SegStarts(I + 1).WchGrp SWAP SegStarts(I).WchObj, SegStarts(I + 1).WchObj END IF
NEXT I
NEXT
FOR I = 1 TO NoOfSegs 'tempsegs are unjustified segs TempSegs(I).AStartPt = SegStarts(I).AStartPt TempSegs(I).BStartPt = SegStarts(I).BStartPt TempSegs(I).CStartPt = SegStarts(I).CStartPt TempSegs(I).DStartPt = SegStarts(I).DStartPt TempSegs(I).WChGrp = SegStarts(I).WchGrp TempSegs(I).WchObj = SegStarts(I).WchObj IF SegStarts(I + 1).AStartPt <> 0 TIN
TempSegs(I).AEndPt = SegStarts(I + 1).AStartPt - 1 TempSegs(I).BEndPt = SegStarts(I + 1).BStartPt - 1 Te~Segs(I).CEndPt = SegStarts(I + 1).CStartPt - 1 TempSegs(I).DEndPt = SegStarts(I + 1).DStartPt - 1 ELSE
TempSegs(I).AEndPt = ALns(NoOfLines).Fin TempSegs(I).BEndPt = BLns(NoOfLines).Fin TempSegs(I).CEndPt = CLns(NoOfLines).Fin TempSegs(I).DEndPt = DLns(NoOfLines).Fin END IF
NEXT
FOR I = 1 TO NoOfSegs FOR J = 1 TO NoOfLines IF TempSegs(I).AStartPt >= ALns(J).Beg AND
TempSegs(I).AEndPt <= ALns(J).Fin THIN TempSegs(I).WchLine = J
NEXT
NEXT
REDIM SegStarts(0) AS TempSegType END SUB
SUB NTkTetLns (Vertex, OtherVertex) LINE (TEnds(Vertex).lx, TEnds(Vertex).y)-(TEnds(OtherVertex).lx, TEnds(OtherVertex).y), LCol LINE (TEnds(Vertex).rx, TEnds(Vertex).y)-(TEnds(OtherVertex).rx, TEnds(OtherVertex).y), RCol END SUB
SUB MkUniPath (Text$, MkUniPathFor) ******************************* Draw stuff in background LOCATE 1, 1 SELECT CASE NIkUniPathFor CASE eObjPath: PRINT "Draw Path In Space Or Static Position For "
+ Text$
CASE eTScript SetupTetra LOCATE 1, 1: PRINT "Draw Action Control Graph For " + Text$
IF LinkingToPreviousRun = True THEN
LOCATE 2, 1: BEEP
PRINT "Chained --You MUST Start Action Control Graph Exactly At <A> Source Pose Vertex!"
END IF
CASE eWarpPath: PRINT "Draw Path For Warp Handle"
CASE eWaveShape: PRINT "Draw Wave"
CASE eWindPath: PRINT "Draw Wind Path"
END SELECT
SetA FastWorkArraylXPg + 3 - gBuildToggle, 0, 0 ' Inhibit initial erase ******************************* Wait for button down WHILE INP(889) >= 128 WndIn IF XYZDiff = True THEN
ShowCrsr LOCATE 2, 40: PRINT "Z="; XYZ.Z
SELECT CASE MkUniPathFor CASE eObjPath: ShowObjOnPath WchObj, Obj2, XYZ
CASE eTScript: ShowGroupTScript WchGrp, Group2, ScanIndex, "Temp"
END SELECT
END IF
WEND
******************************* Draw path Index = 0 WHILE INP(889) < 128 WndIn IF XYZDiff = True THEN
ShowCrsr LOCATE 2, 40: PRINT "Z="; XYZ.Z

SELECT CASE MkUniPathFor CASE eObjPath: ShovuObjOnPath WchObj, Obj2, XYZ
CASE eTScript: ShowGroupTScript WchGrp, Group2, ScanIndex, "Temp"
END SELECT
Draw3DPoint XYZ, -1 Index = Index + 1 EnterRawPt Index END IF
WEND
******************************* RedraW path 8S S011d and COnflI?Q ok SELECT CASE MkUniPathFor CASE eTScript: SetupTetra CASE eWarpPath: ShowAllFnlSegs 1: ShowAllSegStarts CASE eWaveShape: Draw3DLine WaveRefStart, WaveRefEnd, -1 END SELECT
Smooth RawPtsXPg, TempPtsXPg, 3, False DrawArray RawPtsXPg, 0, True DrawArray TempPtsXPg, -1, True END SUB
SUB Mrk (Kind, FlatStereo) 'FlatStereo: 0=flat 1=stereo IF FlatStereo = 1 Tf~1 CaIcLXRXY
IF FlatStereo = 0 THEN CalcFlatXY
CalcMrkrPts IF MrkrPts.lx > 5 AND MrkrPts.rx > 5 AND
MrkrPts.lx < 645 AND MrkrPts.rx < 645 AND
MrkrPts.y > 5 AND MrkrPts.y < 345 TF~1 IF Rind = 0 TF~T
PUT (MrkrPts.lx, MrkrPts.y), CmrkL
PUT (MrkrPts.rx, MrkrPts.y), CmrkR
END IF
IF Kind = 1 Tf~N
PUT (MrkrPts.lx, MrkrPts.y), SqmrkL
PUT (MrkrPts.rx, MrkrPts.y), SqmrkR
END IF
IF Kind = 2 TF~N
PUT (MrkrPts.lx, MrkrPts.y), TrmrkL
PUT (MrkrPts.rx, MrkrPts.y), TrmrkR
END IF
IF Kind = 3 Tf~N
PUT (MrkrPts.lx, MrkrPts.y), CrossMrkL
PUT (MrkrPts.rx, MrkrPts.y), CrossMrkR
END IF
END IF
END SUB
SUB MrkGrpC'ntr (Message$, Pose, WchGrp) DefnPt MarkedGrpCntr, Message, " 3 IF Pose = 1 Tf~N : AGrpCntr(WchGrp) = MarkedGrpCntr IF Pose = 2 TF~N : BGrpCntr(WchGrp) = MarkedGrpCntr IF Pose = 3 TIN : CGrpCntr(WchGrp) = MarkedGrpChtr IF Pose = 4 TF~1 : DGrpCntr(WchGrp) = MarkedGrpC~tr END SUB
SUB MrkIntermtLine CLS
ShowAllFnlSegs 1 Finished = False DO WHILE Finished = False SELECT CASE UserChoice("", "ChooseLine", "Finished", " , " , "") FindMrkdPtInAPose ThisOne, "Mark The Line"
WchLine = FindAlnFOrIntermit(ThisOne) ALns(WchLine).Intermit = True ALns(WchLine).KeyForm = UserChoice("Which Source Pose Shows This Line?", "A", "B", "C", "D", "") LOCATE 4, 1 INPUT "Enter TriggerPt Range is 0 (always visible) TO 1 (vis if TScript at vertex)"; ALns(WchLine).Threshold LOCATE 4, 1: PRINT SPACE$(79) EXIT DO
END SELECT
LOOP
CLS
END SUB
SUB MrkObjAnchorPt CLS
ShowAllFnlSegs 1 Text$ _ "Mrk Point That Will Stay On Anchor"
FindMrkdPtInAPose ThisOne, Text$
END SUB
SUB MrkObjCntr (Message$, WchPose, WchObj) DefnPt MarkedObjCntr, Message, " , 3 IF WchPose = 1 THEN : AObjCntr(WchObj) = MarkedObjCntr IF WchPose = 2 THEN : BObjCntr(WchObj) = MarkedObjCntr IF WchPose = 3 THEN : CObjCntr(WchObj) = MarkedObjChtr IF WchPose = 4 THEN : DObjCntr(WchObj) = MarkedObjCntr END SUB
SUB MrkScaffoldCntr (Message$, WchObj, WchPose) DIM UniObjCntr(0) AS t3DPoint DefnPt UniObjCntr(0), Message, "MrkScaffoldCntr", 3 IF WchPose > 1 THEN
Mrk 3, 1 'removes mrk put on by defnpt from screen UniObjCntr(0).Z = ZPlane XYZ = UniObjCntr(0) Mrk 2, 1 END IF
SELECT CASE WchPose CASE 1: AScaffoldCntr(1) = UniObjCntr(0) ZPlane = UniObjCntr(0).Z
CASE 2: BScaffoldCntr(1) = UniObjCntr(0) ImDrawingCentrDisp(2).x = BScaffoldCntr(1).x - ASCaffoldCntr(1).x ImDrawingCentrDisp(2).y = BScaffoldCntr(1).y - AScaffoldCntr(1).y ImDrawingCentrDisp(2).Z = BScaffoldCntr(1).Z - AScaffoldCntr(1).Z
CASE 3: CScaffoldCntr(1) = UniObjCntr(0) ImDrawingCentrDisp(3).x = CScaffoldCntr(1).x - AScaffoldCntr(1).x ImDrawingCentrDisp(3).y = CScaffoldCntr(1).y - AScaffoldCntr(1).y ImDrawingCentrDisp(3).Z = CScaffoldCntr(1).Z - AScaffoldCntr(1).Z
CASE 4: DScaffoldCntr(1) = UniObjCntr(0) ImDrawingCentrDisp(4).x = DScaffoldCntr(1).x - AScaffoldCntr(1).x ImDrawingCentrDisp(4).y = DScaffoldCntr(1).y - AScaffoldCntr(1).y ImDrawingCentrDisp(4).Z = DScaffoldCntr(1).Z - AScaffoldCntr(1).Z
END SELECT
LOCATE 4, 1: PRINT SPACE$(45) END SUB
SUB MrkScaffoldPts DIM ADispPt(0) AS t3DPoint Message$ _ "Mark Scaffold RefPoints; <Done> If Finished, Or No Pts Wanted"
ScaffoldPtIndex = 0 Ans$ _ °"
Do UNTIL Ans$ = c$
DefnPt ADispPt(0), Message, "DefnScaffoldPts", 2 ScaffoldPtIndex = ScaffoldPtIndex + 1 ScaffoldDisp(ScaffoldPtIndex).x = AScaffoldCntr(1).x - ADispPt(0).x ScaffoldDisp(ScaffoldPtlndex).y = AScaffoldCntr(1).y - ADispPt(0).y ScaffoldDisp(ScaffoldPtlndex).Z = AScaffoldCntr(1).Z - ADispPt(0).Z
NoOfScaffoldPts = ScaffoldPtlndex LOOP
IF Ans$ = C$ TfE;N
NoOfScaffoldPts = NoOfScaffoldPts - 1 LOCATE 5, 1: PRINT SPACE$(75) END IF
END SUB
SUB MrkVislnvisLine CLS
ShowAllFnlSegs 1 Finished = False DO WHILE Finished = False SELECT CASE UserChoice(~~, ~", ~ChooseLine", "Finished", "", "") FindMrkdPtInAPose ThisOne, "Mark The Line"
WchLine = FindAlnForIntermit(ThisOne) INPUT "Appears At Frame"; ALns(WchLine).StartVis INPUT "Disappears At Frame"; ALns(WchLine).EndVis EXIT DO
END SELECT
LOOP
CLS
END SUB
SUB MtChPtsPartl NoOfMtchPts = 0 OneSetChosen = False DoneMtChPts = False LOCATE 4, 1: PRINT "Reminder: Make MatchPts At Location Of Future Velcro Pts, If Any°
PRINT "Don't Put MatchPt Near Start Or End Of A Line!"

FOR WchLine = 1 TO NoOfLines CLS
ShowLn 1, WchLine, -1 WchPOSe = 1 FOR q = 1 TO NoOtMtchPts - 1 IF MtchPts(q, 7) = WchLine THEN
XYZ.x = GetAReal!(APtsXPg + 3 * (WchPose - 1), MtchPts(q, WchPose)) XYZ.y = GetAReal!(APtsYPg + 3 * (WchPose - 1), MtchPts(q, WchPOSe)) XYZ.Z = GetAReal!(APtsZPg + 3 * (WchPose - 1), MtchPts(q, WchPose)) Mrk 0, 1 END IF
NEXT
LOCATE 2, 1: PRINT "Avail MatchPts = , 50 - NoOfMtchPts: SLEEP 1 WHILE Confirm("Make (More) MatchPts On This Line?") NoOfMtchPts = NoOfMtchPts + 1 AbortMatchPt = False FOR WchPose = 1 TO 4 CLS 'show existing mtchpts ShowLn WchPose, WchLine, -1 FOR q = 1 TO NoOfMtchPts - 1 IF MtchPts(q, 7) = WchLine THEN
XYZ.x = GetAReal!(APtsXPg + 3 * (WchPose - 1), MtchPts(q, WchPose)) XYZ.y = GetAReal!(APtsYPg + 3 * (WchPose - 1), MtchPts(q, WchPose)) XYZ.Z = GetAReal!(APtsZPg + 3 * (WChPose - 1), MtchPts(q, WchPose)) Mrk 0, 1 END IF
NEXT
MtchPtsPart2 WchPose, NoOfMtchPts IF AbortMatchPt = True THEN
NoOfMtchPts = NoOfMtchPts - 1 CLS
ShowLn 1, WchLine, -1 EXIT FOR
END IF
NEXT 'next pose CLS
LOCATE 2, 1: PRINT "Avail MatchPts = , 50 - NoOfMtchPts: SLEEP 1 ShowLn 1, WchLine, -1 FOR q = 1 TO NoOfMtchPts IF MtchPts(q, 7) = WchLine THEN
XYZ.x = GetAReal!(APtsXPg + 3 * (1 - 1), MtchPts(q, 1)) XYZ.y = GetAReal!(APtsYPg + 3 * (1 - 1), MtchPts(q, 1)) XYZ.Z = GetAReal!(APtsZPg + 3 * (1 - 1), MtchPts(q, 1)) Mrk 0, 1 END IF
NEXT
WEND 'make more on same line NEXT 'next line END SUB
SUB MtchPtsPart2 (WchPose, MtchPtNdx) I = wchPose SELECT CASE I

IF OneSetChosen THEN
IF 50 - MtchPtNdx < 2 THEN
BEEP: BEEP: BEEP
PRINT "Last Avl Match Pt!"
END IF

ELSE
LOCATE 2, 1: PRINT "Mrk Match Pt in A Image"
END IF
CASE 2: LOCATE 2, 1: PRINT "Mrk Matching Pt in B Image "
CASE 3: LOCATE 2, 1: PRINT "Mrk Matching Pt in C Image "
CASE 4: LOCATE 2, 1: PRINT "Mrk Matching Pt in D Image "
END SELECT
LnNo = WchLine - 1 WchPoseForHili = 2 ShowGuideMatchPts I
MtchPtsPart3 I, MtchPtNdx END SUB
SUB MtchPtsPart3 (WchPOSe, MtchPtNdx) FoundIt = False MaybeMore:
A$ _ "Erase": C$ _ "AbortPt": B$ _ "Good": D$ _ "Adj"
Wndchs " , A$, B$, C$, D$, "x", Ans$, 1 DO
WndIn ShowCrsr IF XYZ.y < 15 THEN
WndSlct Ans$, 1 SELECT CASE Ans$
CASE A$ 'erase XYZ = FoundPt Mrk 0, 1 FoundIt = False CASE B$ 'good IF FoundIt = True THEN EXIT DO
CASE E$ 'alldone IF WchPose = 1 AND OneSetChosen = True THEN
DoneMtchPts = True EXIT DO
END IF
CASE D$ 'adj IF FoundIt = True THEN
AdjMtchPt WchPose, WchLine, MtchPtNdx GOTO MaybeMore END IF
CASE C$ 'abort BEEP: BEEP
LOCATE 6, 1: PRINT "ABORTING THIS MATCH POINT": SLEEP 1 LOCATE 6, 1: PRINT SPACE$(45) AbortMatchPt = True EXIT DO
END SELECT
END IF
IF INP(889) < 128 AND FoundIt = False THEN
FindDesPt WchPose, WchLine IF FoundIt = True THEN
SOUND 50, 3 Mrk 0, 1 MtchPts(MtchPtNdx, WchPose) = ThisOne MtchPts(MtchPtNdx, 5) = ALns(WchLine).WchGrp MtchPts(MtchPtNdx, 6) = ALns(WchLine).WchObj MtchPts(MtchPtNdx, 7) = WchLine END IF
IF WchPose = 1 AND FoundIt = True TF~N
AtLeastOneChosen = True -------get order of mtchpts in ALn:
ALnPlaceNdx = 0 FOR q = 1 TO MtchPtNdx IF MtchPts(q, 7) = WchLine THEN
ALnPlaceNdx = ALnPlaceNdx + 1 ALnPlace(ALnPlaceNdx, 0) = q 'which mtchpt ALnPlace(ALnPlaceNdx, 1) = MtchPts(q, 1) 'APose pt END IF
NEXT
'sort according to pt position:
FOR J = 1 TO ALnPlaceNdx - 1 FOR I = 1 TO ALnPlaceNdx - J
IF ALnPlace(I, 1) > ALnPlace(I + 1, 1) Tf~N
SWAP ALnPlace(I, 0), ALnPlace(I + 1, 0) SWAP ALnPlace(I, 1), ALnPlace(I + 1, 1) END IF
NEXT I
NEXT
END IF
IF WchPose > 1 AND FoundIt = True TFO;N
'sort mtchpts for this Pose and compare with ALn 'if not same order it's no good OtherLnPlaceNdx = 0 FOR q = 1 TO MtchPtNdx IF MtchPts(q, 7) = WchLine TI~1 OtherLnPlaceNdx = OtherLnPlaceNdx + 1 OtherLnPlace(OtherLnPlaceNdx, 0) = q 'which mtchpt OtherLnPlace(OtherLnPlaceNdx, 1) = MtchPts(q, WchPose) END IF
NEXT
'sort according to pt position:
FOR J = 1 TO OtherLnPlaceNdx - 1 FOR I = 1 TO OtherLnPlaceNdx - J
IF OtherLnPlace(I, 1) > OtherLnPlace(I + 1, 1) TF~N
SWAP OtherLnPlace(I, 0), OtherLnPlace(I + 1, 0) SWAP OtherLnPlace(I, 1), OtherLnPlace(I + 1, 1) END IF
NEXT I
NEXT
FOR I = 1 TO OtherLnPlaceNdx IF OtherLnPlace(I, 0) <> ALnPlace(I, 0) THEN
LOCATE 6, 1: BEEP
PRINT "Erased --Not In Correct Order. Maybe Line Direction Is Reversed."
PRINT "If So, Quit MatchPts And Reverse Line) Else Do MatchPt Again"

LOCATE 6, 1: PRINT SPACE$(65) LOCATE 7, 1: PRINT SPACE$(65) FoundIt = False Mrk 0, 1 EXIT FOR
END IF
NEXT
END IF
AtLeastOneChosen = True IF WchPose = 4 THEN OneSetChosen = True END IF
LOOP
END SUB
SUB MyDelay (HowLong) FOR q = 1 TO 200 FOR I = 1 TO HowLong * 3000: NEXT I
NEXT
END SUB
SUB NameGroups FOR I = 1 TO NoOfGroups CLS
FOR J = 1 TO NoOfLines IF ALns(J).WchGrp = I THEN ShowLn 1, J, -1 NEXT
INPUT "Name For This"; Name$
Group(I).Label = UCASE$(Name$) NEXT
GroupsNamed = True IF NoOfGroups = 1 THEN
Object(1).Label = UCASE$(Name$) ObjectNamed = True END IF
END SUB
SUB NameObjects FOR I = 1 TO NoOfObjects GroupsInThisObj = 0 FOR J = 1 TO NoOfGroups IF Group(J).WchObj = I THEN
GroupsInThisObj = GroupsInThisObj + 1 WchGrpInThisObj = J
END IF
NEXT
IF GroupsInThisObj = 1 THEN
Object(I).Label = Group(WchGrpInThisObj).Label ELSE
CLS
ShowObj I, 1 INPUT "Name For This Object"; Name$
Object(I).Label = UCASE$(Name$) END IF
NEXT
ObjectsNamed = True END SUB
SUB NameWarps CLS
WarpIndex = 0 LOCATE 2, 1: PRINT "TO FINISH HIT <Enter>"
DO
FOR I = 1 TO WarpIndex LOCATE I + 5: PRINT "Warp No"; I; Warp(I).Label NEXT
WarpIndex = WarpIndex + 1 LOCATE 4, 1: INPUT "Warp Name"; Name$
LOCATE 4, 1: PRINT SPACE$(65) IF Name$ _ " " TILT
WarpIndex = WarpIndex - 1 EXIT DO
END IF
Warp(WarpIndex).Label = UCASE$(Name$) FOR I = 1 TO WarpIndex LOCATE I + 5: PRINT "Warp No"; I; Warp(I).Label NEXT
PRINT "Remaining Warps Available:"; 6 - WarpIndex LOOP
NoOfWarps = WarpIndex CLS
FOR I = 1 TO WarpIndex LOCATE I + 5: PRINT "Warp No"; I; Warp(I).Label NEXT
END SUB
SUB NoMtchPts FOR I = 1 TO NoOfLines TempSegs(I).AStartPt = ALns(I).Beg TempSegs(I).AEndPt = ALns(I).Fin TempSegs(I).BStartPt = BLns(I).Beg TempSegs(I).BEndPt = BLns(I).Fin TempSegs(I).CStartPt = CLns(I).Beg TempSegs(I).CEndPt = CLns(I).Fin TempSegs(I).DStartPt = DLns(I).Beg TempSegs(I).DEndPt = DLns(I).Fin TempSegs(I).WchGrp = ALns(I).WchGrp TempSegs(I).WchObj = ALns(I).WChObj TempSegs(I).WchLine = I
NEXT
NoOfSegs = NoOfLines AllMtchPtsOK = True END SUB
SUB OldSmooth (RuffPts() AS t3DPoint, ShioothPts() AS t3DPoint, SmoothRange) PtLimit = RuffPts(0).x IF PtLimit < SmoothRange + 1 TF~N
SmoothRange = PtLimit - 1 IF SmoothRange < 0 TFiEn1 SmoothRange = 0 END IF
TotalRange = 2 * SmoothRange + 1 FOR I = 1 + SmoothRange TO PtLimit - SmoothRange xsum! = 0: ysum! = 0: zsum! = 0 FOR J = I - SmoothRange TO I + SmoothRange xsum! = xsum! + RuffPts(J).x ysum! = ysum! + RuffPts(J).y zsum! = zsum! + RuffPts(J).Z
NEXT J
SmoothPts(I).x = xsum! / TotalRange SmoothPts(I).y = ysum! / TotalRange SmoothPts(I).Z = zsum! / TotalRange NEXT I
FOR I = 0 TO SmoothRange 'puts in pts at start SmoothPts(I) = RuffPts(I) NEXT I
FOR I = PtLimit - SmoothRange TO PtLimit 'puts in end pts SmoothPts(I) = RuffPts(I) NEXT I
END SUB
SUB PaintLoop PRINT "will be paint Loop"

END SUB
SUB PathAdj PathToAdj = UserChoice("Adj Path For Which Object?", Object(1).Label, Object(2).Label, Object(3).Label, " , "") AdjPathAlongXYZ PathToAdj END SUB
SUB PathArrayPositPtr (FrameNo, WchPath, ObjPathPos AS t3DPoint) ObjPathPos.x = GetAReal!(PathlXPg + 3 * (WchPath - 1), FrameNo) ObjPathPos.y = GetAReal!(PathlYPg + 3 * (WchPath - 1), FrameNo) ObjPathPos.Z = GetAReal!(PathlZPg + 3 * (WchPath - 1), FrameNo) END SUB
SUB PathShiftToMatchPrevRun (WchObj) DIM DiffInPosit AS t3DPoint SELECT CASE WchObj DiffInPosit.x = ObjFinalPositions(1).FinalPositObjl.x GetAReal!(TempPtsXPg, 1) DiffInPosit.y = ObjFinalPositions(1).FinalPositObjl.y GetAReal!(TempPtsYPg, 1) DiffInPosit.Z = ObjFinalPositions(1).FinalPositObjl.Z
GetAReal!(TempPtsZPg, 1) DiffInPosit.x = ObjFinalPositions(1).FinalPositObj2.x GetAReal!(TempPtsXPg, 1) DiffInPosit.y = ObjFinalPositions(1).FinalPositObj2.y GetAReal!(TempPtsYPg, 1) DiffInPosit.Z = ObjFinalPositions(1).FinalPositObj2.Z
GetAReal!(TempPtsZPg, 1) DiffInPosit.x = ObjFinalPositions(1).FinalPositObj3.x GetAReal!(TempPtsXPg, 1) DiffInPosit.y = ObjFinalPositions(1).FinalPositObj3.y GetAReal!(TempPtsYPg, 1) DiffInPosit.Z = ObjFinalPositions(1).FinalPositObj3.Z
GetAReal!(TempPtsZPg, 1) END SELECT
FOR I = 1 TO GetA(TempPtsXPg, 0) SetArrayReal TempPtsXPg, I, GetAReal!(TempPtsXPg, I) + DiffInPosit.x SetArrayReal TempPtsYPg, I, GetAReal!(TempPtsYPg, I) + DiffInPosit.y SetArrayReal TempPtsZPg, I, GetAReal!(TempPtsZPg, I) + DiffInPosit.Z
NEXT
LOCATE 4, 1: PRINT "Shifting Path To Match Start To End Of Previous Run"

LOCATE 4, 1: PRINT SPACE$(75) END SUB
SUB PlaceFrmChrtS~mcPtsOnPath (Kind, WchNo) SortSyncPtsForApplic Kind, WchNo SELECT CASE Kind CASE l: ScanSyncPtsName = eScanForObjPathSyncPt CASE 2: ScanSyncPtsName = eScanForTransSyncPt CASE 3: ScanSyncPtsName = eScanForWarpSyncPt END SELECT
FOR I = 2 TO NoOfSortedSyncPts - 1 'leaves out start and end IF Kind = 1 THEN
WchPath = Object(Group(WchGrp).WchObj).PathNo IF WchPath = 1 THEN ShowObjPath PathlXPg, 1 IF WchPath = 2 THEN ShowObjPath Path2XPg, 1 IF WchPath = 3 THEN ShowObjPath Path3XPg, 1 END IF
LOCATE 3, 1 PRINT "MARK LOCATION FOR SYNC PT: ', SortedSyncPts(I).Label FoundIt = False DO WHILE FoundIt = False WndPtScan WchObj, Obj2, WchGrp, Grp2, TempPtsXPg, GetA(TempPtsXPg, 0), 1, ScanSyncPtsName IF FoundIt = True THEN
MyDelay 1 SortedSyncPts(I).TempPtsIndex = ThisOne SOUND 4000, 3 EXIT DO
END IF
LOOP
LOCATE 5, 1 PRINT "Marked So Far:"
LOCATE 4 + I
PRINT SortedSyncPts(I).Label; " At TempPt"; ThisOne; " Frm";
SortedSyncPts(I).Frame NEXT
END SUB
SUB PlaceSyncPtsOnFrmChrt (Kind, WchOne, Text) CLS
Range = 3 SyncPtIndexAtStartOfFrmChrt = SyncPtIndex MkFrameScreenV4 Kind, WchOne ShowSyncPtLines SyncPtIndexAtStartOfFrmChrt DD
WndIn CalcFlatXY
ShowFlatCrsr IF XYZ.y < 15 THEN WndSlct Ans$, 1 FoundIt = False LOCATE 2, 1: PRINT "Place Desired Sync Pt "
DO WHILE FoundIt = False FindFrmInChartObjGrpWarp Kind, WchOne, WchFrame XLocat = XYZ.x SyncPtIndex = SyncPtIndex + 1 syncpts(SyncPtIndex).Frame = WchFrame LOOP
UsingExistSyncPt = False xPos = 40 + Interval! * (WchFrame - 1) Y'POS = 70 Height = 34 LINE (XPos, YPos)-(XPos, Y'Pos + Height), 14 SELECT CASE Kind CASE 1: syncpts(SyncPtIndex).WchObj = WchOne CASE 2: syncpts(SyncPtIndex).WchGrp = WchOne CASE 3: syncpts(S~ncPtIndex).WchWrp = WchOne END SELECT
FOR q = 1 TO SyncPtIndex - 1 'becuz last syncpt has just been put on IF syncpts(q).Frame = WchFrame THEN
syncpts(SyncPtIndex).Label = syncpts(q).Label syncpts(SyncPtlndex).TempPtsIndex = syncpts(q).TempPtsIndex ShowSyncPtLines SyncPtIndexAtStartOfFrmChrt LOCATE 1, 1: PRINT "Using Existing Name : MyDelay 1 UsingExistS~mcPt = True END IF
NEXT
IF UsingExistSyncPt = False THEN
LOCATE 1, 1: INPUT "Name For This SyncPt ; Text$
syncpts(SyncPtIndex).Label = STR$(WchFrame) + "-" + UCASE$(Text$) ShowSyncPtLines SyncPtIndexAtStartOfFrtnChrt END IF
LOCATE 1, 1: PRINT SPACE$(75) C$ _ "More": D$ _ "Finished"
WndChs "~, "x", "x°, C$, D$, 'x', Ans$, 0 LOCATE 1, 1: PRINT SPACE$(75) LOCATE 2, 1: PRINT SPACE$(75) IF Ans$ = D$ THEN EXIT DO
ShowSyncPtLines SyncPtIndexAtStartOfFrmChrt: SLEEP 1 LAOP
CLS
END SUB
SUB PlaceSyncPtsOnTempPath (Kind, WhichOne, PathText$) SyncPtIndexSoFar = SyncPtIndex LOCATE 1, 1: PRINT PathText$
SELECT CASE Kind CASE 1: ScanSyncPtsName = eScanForObjPathSyncPt CASE 2: ScanSyncPtsName = eScanForTransSyncPt CASE 3: ScanSyncPtsName = eScanForWarpSyncPt END SELECT
S~ncPtsOK = False WHILE NOT SyncPtsOK
DO
ErsMnu SELECT CASE UserChoice("MARK SYNC POINT (Touch <Mark> First)", "", "Mark", " , "", "Finished") EXIT DO

WndPtScan WchObj, Obj2, WchGrp, Gzp2, TempPtsXPg, GetA(TempPtsXPg, 0), 1, eScanForObjPathSyncPt SOUND 4000, 2 END SELECT
SyncPtIndex = SyncPtIndex + 1 syncpts(SyncPtIndex).T~rpPtsIndex = ThisOne syncpts(SyncPtIndex).Frame =
CINT((syncpts(SyncPtIndex).TempPtsIndex /
GetA(TempPtsXPg, 0)) * NoOfFrames) IF Kind = 1 THEN
syncpts(SyncPtIndex).WchObj = WhichOne END IF
IF Kind = 2 THEN
syncpts(SyncPtIndex).WchGrp = WhichOne END IF
IF Kind = 3 THEN
syncpts(SyncPtIndex).WchWrp = WhichOne END IF
LOCATE 1, 1 INPUT "Name For This Sync Pt ; Name$
LOCATE 1, 1: PRINT SPACE$(79) syncpts(SyncPtIndex).Label = STR$(syncpts(SyncPtIndex).Frame) +
-" + UCASE$(Name$) IF SyncPtIndex > 0 THEN
LOCATE 5, 1 PRINT "Marked So Far."
FOR T = SyncPtIndexSoFar + 1 TO SyncPtlndex IF T > 0 THEN PRINT syncpts(T).Label; " At TempPt";
syncpts(T).TempPtsIndex; " Frm"; syncpts(T).Frame NEXT
END IF
LOOP
IF Confirm("SyncPtsOK") THEN
SyncPtsOK = True ELSE
SyncPtIndex = SyncPtIndexSoFar CLS
DrawPartialArray T~npPtsXPg, 1, GetA(TempPtsXPg, 0), -1, False END IF
WEND
EI~ SUB
SUB PutDxwMnuOnScrn (Text$, WchPose, Version) 'Version 0 is when drawing, 1 when finished ErsMnu IF Scaffold = True THEN A$ _ "TogglScaff" ELSE A$ _ "x"
IF WchPose = 1 THEN B$ _ "Line Color" ELSE B$ _ "UsePrevLn"
IF LnNo > 0 THEN D$ _ "Del Last" ELSE D$ _ "x"
IF WchPOSe = 1 THEN E$ _ "x" ELSE E$ _ "Rpt A Pose"
SELECT CASE WchPose A$ _ "Name Line"
IF FrstLn = True THEN C$ _ "Finished A" ELSE C$ _ "x"
WndChs Text, A$, B$, C$, D$, E$, Ans$, I

IF Version = 0 THEN C$ _ "x"
IF Version = 1 THEN C$ _ "Finished B": B$ _ "x": E$ _ "x"
WndChs Text, A$, B$, C$, D$, E$, Ans$, 1 IF Version = 0 Tf~1 C$ _ "x"
IF Version = 1 THEN C$ _ "Finished C": B$ _ "x": E$ _ "x"
WndChs Text, A$, B$, C$, D$, E$, Ans$, 1 IF Version = 0 THEN C$ _ "x"
IF Version = 1 THEN C$ _ "Finished D": B$ _ "x": E$ _ "x"
WndChs Text, A$, B$, C$, D$, E$, Ans$, 1 END SELECT
IF Version = 0 AND WchPose = 1 THEN
LCX'~.TE 2 , 1 PRINT "DRAW <" + CHR$(64 + WchPose) + "> SOURCE POSE"
END IF
IF Version = 0 AND WchPose > 1 THEN
LOCATE 2 , 1 PRINT "DRAW CORRESPONDING LINE " + ALns(LnNo).Label +
" IN <" + CHR$(64 + WchPose) + "> SOURCE POSE"
END IF
IF Version = 1 THEN LOCATE 2, 1: PRINT SPACE$(50) END SUB
SUB PutInGrp (WchLine, WchGrp) ALns(WchLine).WchGrp = WchGrp BLns(WchLine).WchGrp = WchGrp CLns(WchLine).WchGrp = WchGrp DLns(WchLine).WchGrp = WchGrp IF NoOfGroups < WchGrp THEN NoOfGroups = WchGrp END SUB
SUB PutInObj (WchGrp, WchObj) FOR K = 1 TO NoOfLines IF ALns(K).WchGrp = WchGrp THEN
ALns(K).WchObj = WchObj BLns(K).WchObj = WchObj cLns(K).wchobj = wchobj DLns(K).WchObj = WchObj Group(WchGrp).WchObj = WchObj END IF
NEXT
IF NoOfObjects < WchObj THEN NoOfObjects = WchObj END SUB
SUB ReCntrGrp (WchGrp, PtArray, CenterOfGrp() AS t3DPoint) DIM Disp(0) AS t3DPOint Disp(0).x = CenterOfGrp(WchGrp).x - AGrpCntr(WchGrp).x Disp(0).y = CenterOfGrp(WchGrp).y - AGrpCntr(WchGrp).y Disp(0).Z = CenterOfGrp(WchGrp).Z - AGrpCntr(WchGrp).Z
FOR J = 1 TO NoOfSegs IF FinlSgs(J).WchGrp = WchGrp THE~1 FOR I = FinlSgs(J).Beg TO FinlSgs(J).Fin SetArrayReal PtArray, I, GetAReal!(PtArray, I) - Disp(0).x SetArrayReal PtArray+1, I, GetAReal!(PtArray+1, I) - Disp(0).y SetArrayReal PtArray+2, I, GetAReal!(PtArray+2, I) - Disp(0).Z
NEXT
END IF
NEXT
END SUB

SUB ReCntrObj (WchObj, PtArray, CenterOfObj() AS t3DPOint) DIM Disp(0) AS t3DPoint Disp(0).x = CenterOfObj(WchObj).x - AObjCntr(WchObj).x Disp(0).y = CenterOfObj(WchObj).y - AObjCntr(WchObj).y Disp(0).Z = CenterOfObj(WchObj).Z - AObjCntr(WchObj).Z
FOR J = 1 TO NoOfSegs IF FinlSgs(J).WchObj = WchObj THEN
FOR I = FinlSgs(J).Beg TO FinlSgs(J).Fin SetArrayReal PtArray, I, GetAReal!(PtArray, I) - Disp(0).x SetArrayReal PtArray+1, I, GetAReal!(PtArray+1, I) - Disp(0).y SetArrayReal PtArray+2, I, GetAReal!(PtArray+2, I) - Disp(0).Z
NEXT
END IF
NEXT
END SUB
SUB ScanPoseTrans (ForWhat, WchGrp, WchObjPath, FrameNo) 'scans tetra space by wand position and 'shows resulting group transform in a path position according to path and 'which frame has been set (or in a static position if group is static) DIM ObjCntr AS t3DPoint DIM Disp AS t3DPoint DIM Pt AS t3DPoint ErsMnu LOCATE 1, 1 IF ForWhat = 0 THEN PRINT "Explore Possible Action Available For "; Group(WchGrp).Label; " (click to exit)"
SetupTetra ZCorrection = 40 LensFocalLength = 35 SetA FastWorkArraylXPg + 3 - BuildToggle, 0, 0 'Inhibit initial erase DO
Wndln ShowCrsr IF ForWhat <> 0 THEN
IF XYZ.y c 15 THEN
WndSlct Ans$, 1 SELECT CASE Ans$
CASE B$
FrameNo = FrameNo - 1 CASE C$
FrameNO = FrameNo + 1 END SELECT
END IF
END IF
IF FrameNo > NoOfFrames THEN FrameNo = NoOfFrames IF FrameNo < 1 THEN FrameNo = 1 Ndx = 0 IF CalcTProps(0) THEN '0 is fake frame no;

uses XYZ from Wand Position FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchGrp = WchGrp TIN
StartPt = FinlSgs(SegNo).Beg EndPt = FinlSgs(SegNo).Fin Grp = FinlSgs(SegNo).WchGrp IF ForWhat = 0 OR ForWhat = 2 TF~N
ObjPathPosit.x = AObjCntr(ObjNo).x ObjPathPosit.y = AObjCntr(ObjNo).y ObjPathPosit.Z = AObjCntr(ObjNo).Z
END IF
IF ForWhat = 1 TfIEN 'if exploring Poses there is no path yet PathArrayPositPtr FrameNo, WchObjPath, ObjPathPosit Disp.x = ObjPathPosit.x - AObjCntr(WchObj).x Disp.y = ObjPathPosit.y - AObjCntr(WchObj).y Disp.Z = ObjPathPosit.Z - AObjCntr(WchObj).Z
END IF
NegZ! = AObjCntr(ObjNo).Z / ZDivisor - ZCorrection PFac! = LensFocalLength / NegZ!
FOR PtNo = StartPt TO EndPt STEP INT(GetA(APtsXPg, 0) / 150) + 1 Pt.x = TransGrfVal(0).PropA * GetAReal!(APtsXPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsXPg, PtNo) +
TransGrfVal(0).PropC * GetAReal!(CPtsXPg, PtNo) +
TransGrfVal(0).PropD * GetAReal!(DPtsXPg, PtNo) +
Disp.x Pt.y = TransGrfVal(0).PropA * GetAReal!(APtsYPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsYPg, PtNo) +
TransGrfVal(0).PropC * GetAReal!(CPtsYPg, PtNo) +
TransGrfVal(0).PropD * GetAReal!(DPtsYPg, PtNo) +
Disp.y Pt.2 = TransGrfVal(0).PropA * GetAReal!(APtsZPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsZPg, PtNo) +
TransGrfVal(0).PropC * GetAReal!(CPtsZPg, PtNo) +
TransGrfVal(0).PropD * GetAReal!(DPtsZPg, PtNo) +
Disp.Z
IF WhatFor = 1 OR WhatFor = 2 THEr1 Pt.x = ObjPathPosit.x - (PFac! * (Pt.x - ObjPathPosit.x)) Pt.y = ObjPathPosit.y - (PFac! * (Pt.y - ObjPathPosit.y)) Pt.Z = ObjPathPosit.Z - (PFac! * (Pt.Z - ObjPathPosit.Z)) END IF
Ndx = Ndx + 1 SetArrayReal FastWorkArraylXPg + gBuildToggle, Ndx, Pt.x SetArrayReal FastWorkArraylYPg + gBuildToggle, Ndx, Pt.y SetArrayReal FastWorkArraylZPg + gBuildToggle, Ndx, Pt.Z
NEXT 'point along the seg END IF
NEXT '(seg) END IF
SetA FastWorkArraylXPg + gBuildToggle, 0, Ndx ShowCrsr DrawArray FastWorkArraylXPg + 3 - gBuildToggle, 0, False IF INP(889) < 128 TIN EXIT DO
gBuildToggle = 3 - gBuildToggle DrawArray FastWorkArraylXPg + 3 - gBuildToggle, -1, False LOOP
LOCATE 12, 1: PRINT SPACE$(55) END SUB
SUB SetA (PageNo, Index, Value) SetArray PageNo, Index, Value END SUB
SUB SetUpGlueLoops B$ _ "No": C$ _ "CnfirmEach": D$ _ "Automatic"
WndChs "Glue Loops For Later Painting?", "x", B$, C$, D$, "x", Ans$, 0 SELECT CASE Ans$
CASE B$: MkLineLoop$ = B$
CASE C$: MkLineLoop$ = C$
CASE D$: MkLineLoop$ = D$
END SELECT
GlueLoops = (MkLineLoop$ = C$ OR MkLineLoop$ = D$) END SUB
SUB SetupTetra FOR I = 1 TO 4 XYZ = TPts(I) CalcLXRXY
TEnds(I) = LXRXY
NEXT
COLOR LOCATE 6: PRINT
4: 23, "A"

COLOR LOCATE 5: PRINT
9: 23, "A"

COLOR LOCATE 65:PRINT
4: 23, "C"

COLOR LOCATE 64:PRINT
9: 23, "C"

COLOR LOCATE 41:PRINT
4: 4, "B"

COLOR LOCATE 40:PRINT
9: 4, "B"

COLOR LOCATE 31:PRINT
4: 18, "D"

COLOR LOCATE 35:PRINT
9: 18, "D"

MkTetLns 1, 2 MkTetLns 1, 3 MkTetLns 1, 4 MkTetLns 2, 3 MkTetLns 2, 4 MkTetLns 3, 4 END SUB
SUB ShiftPathOneFrame (WchPath) END SUB
SUB ShortCutGroups NoOfLines = ALns(0).Beg IF NoOfLines = 1 Tf~N
ALns(1).WchGrp = 1: BLns(1).WchGrp = 1 CLns(1).WchGrp = 1: DLns(1).WchGrp = 1 NoOfGroups = 1 GroupsDefnd = True END IF
END SUB
SUB ShortCutObjects IF NoOfGroups = 1 TFIEN
FOR I = 1 TO NoOfLines ALns(I).WchObj = 1: BLns(I).WchObj = 1 CLns(I).WchObj = 1: DLns(I).WchObj = 1 NEXT
Group(1).WchObj = 1 NoOfObjects = 1 ObjectsDefnd = True END IF
END SUB
SUB ShowAllFnlSegs (WchPose) FOR I = 1 TO NoOfLines SELECT CASE WchPose ShowFnlSegs APtsXPg, I, -1 ShowFnlSegs BPtsXPg, I, -1 ShowFnlSegs CPtsXPg, I, -1 ShowFnlSegs DPtsXPg, I, -1 END SELECT
NEXT
END SUB
SUB ShowAllSegStarts FOR I = 1 TO NoOfSegs GetXYZ FinlSgs(I).Beg Mrk 0, 1 END SUB
SUB ShowASegStart (WchSeg) A = FinlSgs(WchSeg).Beg B = FinlSgs(WchSeg).Beg + 8 GetXYZ A
Mrk 0, 1 GetXYZ B
Mrk 2, 1 END SUB
SUB ShowCrsr CalcLXRXY
CalcMrkrPts PUT (LastMrkrPts.lx, LastMrkrPts.y), LCrsr PUT (LastMrkrPts.rx, LastMrkrPts.y), RCrsr PUT (MrkrPts.lx, MrkrPts.y), LCrsr PUT (MrkrPts.rx, MrkrPts.y), RCrsr LastMrkrPts = MrkrPts END SUB
SUB ShowFinalLn (WchPose, LnNo, ShowColor) DrawPartialArray APtsXPg + 3 * (WchPose - 1), ALns(LnNo).FinalStart, ALns(LnNo).FinalEnd, ShowColor, True END SUB
SUB ShowFlatCrsr CalcFlatXY

CalcMrkrPts PUT (LastMrlsPts.lx, LastMrkrPts.y), LCrsr PUT (LastMrkrPts.rx, LastMrkrPts.y), RCrsr PUT (MrkrPts.lx, MrkrPts.y), LCrsr PUT (MrkrPts.rx, MrkrPts.y), RCrsr LastMrkrPts = MrkrPts END SUB
SUB ShowFlatPt (x, y, C) PSET (x, y), C
END SUB
SUB ShowFnlSegs (WchArray, WchLn, ShowColor) FOR I = 1 TO NoOfSegs IF FinlSgs(I).WchLine = WchLn THEr1 DrawPartialArray WchArray, FinlSgs(I).Beg, FinlSgs(I).Fin, ShowColor, False END IF
NEXT
END SUB
SUB ShowGroupTScript (WchGrp, Grp2, ScanIndex, IndexType$) DIM Pt AS t3DPoint 'scans thru tetra space according to wand posit 'shows group where it was first drawn in A Pose IF IndexType$ _ "Temp" TF~N StartVis = 0: EndVis = 10000 ' *************************** Find total points t0 be drawn TotalPoints = 0 FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WChGrp = WchGrp TF~N
TotalPoints=TotalPoints + FinlSgs(SegNo).Fin-FinlSgs(SegNO).Beg+1 END IF
NEXT
' *************************** Build up into toggled buffer area Ndx = 0 IF CalcTProps(0) TF~N '0 is frame no to put prop vals in, using XYZ from wand position in CalcTProps FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchGrp=WchGrp OR FinlSgs(SegNo).WchGrp=Grp2 TF~N
IF IndexType$ _ "Frames" Tf~N
StartVis = ALns(FinlSgs(SegNo).WchLine).StartVis EndVis = ALns(FinlSgs(SegNo).WchLine).EndVis END IF
IF StartVis <= Scanlndex AND EndVis >= ScanIndex THIEN
FOR PtNo = FinlSgs(SegNo).Beg TO FinlSgs(SegNo).Fin STEP INT(TotalPOints / 150) + 1 Ndx = Ndx + 1 Pt.x = TransGrfVal(0).PropA * GetAReal!(APtsXPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsXPg, PtNo) +
TransGrfVal(0).PropC * GetAReal!(CPtsXPg, PtNo) +
TransGrfVal(0).PropD * GetAReal!(DPtsXPg, PtNo) Pt.y = TransGrfVal(0).PropA * GetAReal!(APtsYPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsYPg, PtNo) +
TransGrfVal(0).PropC * GetAReal!(CPtsYPg, PtNo) +
TransGrfVal(0).PropD * GetAReal!(DPtsYPg, PtNo) Pt.Z = TransGrfVal(0).PropA * GetAReal!(APtsZPg, PtNo) +
TransGrfVal(0).PropB * GetAReal!(BPtsZPg, PtNO) +
TransGrfVal(0).PropC * GetAReal!(CPtsZPg, PtNo) +

TransGrfVal(0).PropD * GetAReal!(DPtsZPg, PtNo) SetArrayReal FastWorkArraylXPg + gBuildToggle + 0, Ndx, Pt.x SetArrayReal FastWorkArraylXPg + gBuildToggle + 1, Ndx, Pt.y SetArrayReal FastWorkArraylXPg + gBuildToggle + 2, Ndx, Pt.Z
NEXT 'point along the seg END IF
END IF
NEXT
END IF
SetA FastWorkArraylXPg + gBuildTOggle, 0, Ndx **************************** Undraw previous buffer and draw new one DrawArray FastWorkArraylXPg + 3 - gBuildToggle, 0, False gBuildToggle = 3 - gBuildToggle DrawArray FastWorkArraylXPg + 3 - gBuildToggle, -1, False END SUB
SUB ShowGrp (WchPose, WchGrp, ShowColor) FOR I = 1 TO NoOfSegs IF FinlSgs(I).WchGrp = WchGrp THEN
SELECT CASE WchPose CASE 1: WchArray = APtsXPg CASE 2: WchArray = BPtsXPg CASE 3: WchArray = CPtsXPg CASE 4: WchArray = DPtsXPg END SELECT
DrawPartialArray WchArray, FinlSgs(I).Beg, FinlSgs(I).Fin, ShowColor, False END IF
END SUB
SUB ShowGrpTransInPathPosit (WchObj, WchGrp, Grp2, Index) DIM ObjCntr AS t3DPoint, Disp AS t3DPOint, Pt AS t3DPoint Path = Object(Group(WchGrp).WchObj).PathNo PathArrayPositPtr Index, Path, ObjPathPosit TransPtr Index, WchGzp, AllProp ZCorrection = 40 LensFocalLength = 35 NegZ! = ObjPathPosit.Z / ZDivisor - ZCorrection PFac! = LensFocalLength / NegZ!
Disp.x = ObjPathPosit.x - AObjCntr(WchObj).x Disp.y = ObjPathPosit.y - AObjCntr(WchObj).y Disp.Z = ObjPathPosit.Z - AObjCntr(WchObj).Z
*************************** Find total points to be drawn TotalPoints = 0 FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchGrp=WchGrp OR FinlSgs(SegNo).WchGrp=Grp2 THEN
TotalPoints = TotalPoints+FinlSgs(SegNo).Fin-FinlSgs(SegNo).Beg+1 END IF
NEXT
' *************************** Build up into toggled buffer area Ndx = 0 FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchGrp = WchGrp THEN
IF ALns(FinlSgs(SegNo).WchLine).StartVis <= Index AND
ALns(FinlSgs(SegNo).WchLine).EndVis >= Index THEN
FOR PtNo = FinlSgs(SegNo).Beg TO FinlSgs(SegNo).Fin STEP
INT(TotalPoints / 150) + 1 Ndx = Ndx + 1 Pt.x = AllProp.PropA * GetAReal!(APtsXPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsXPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsXPg, PtNo) +
AllProp.PropD * GetAReal!(DPtsXPg, PtNo) + Disp.x Pt.y = AllProp.PropA * GetAReal!(APtsYPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsYPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsYPg, PtNo) +
AllProp.PropD * GetAReal!(DPtsYPg, PtNo) + Disp.y Pt.Z = AllProp.PropA * GetAReal!(APtsZPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsZPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsZPg, PtNo) +
AllProp.PropD * GetAReal!(DPtsZPg, PtNo) + Disp.Z
Pt.x = ObjPathPosit.x - (PFac! * (Pt.x - ObjPathPosit.x)) Pt.y = ObjPathPosit.y - (PFac! * (Pt.y - ObjPathPosit.y)) Pt.Z = ObjPathPosit.Z - (PFac! * (Pt.Z - ObjPathPosit.Z)) SetArrayReal FastWorkArraylXPg + gBuildToggle + 0, Ndx, Pt.x SetArrayReal FastWorkArraylXPg + gBuildToggle + 1, Ndx, Pt.y SetArrayReal FastWorkArraylXPg + gBuildToggle + 2, Ndx, Pt.Z
NEXT 'point along the seg END IF
END IF
NEXT
TransPtr Index, Grp2, AllProp FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchGrp = Grp2 THEN
IF ALns(FinlSgs(SegNo).WchLine).StartVis <= Index AND
ALns(FinlSgs(SegNo).WchLine).EndVis >= Index THEN
FOR PtNo = FinlSgs(SegNO).Beg TO FinlSgs(SegNo).Fin STEP
INT(TotalPOints / 150) + 1 Ndx = Ndx + 1 Pt.x = AllProp.PropA * GetAReal!(APtsXPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsXPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsXPg, PtNo) +
AllProp.PropD * GetAReal!(DPtsXPg, PtNo) + Disp.x Pt.y = AllProp.PropA * GetAReal!(APtsYPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsYPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsYPg, PtNO) +
AllProp.PropD * GetAReal!(DPtsYPg, PtNo) + Disp.y Pt.Z = AllProp.PropA * GetAReal!(APtsZPg, PtNo) +
AllProp.PropB * GetAReal!(BPtsZPg, PtNo) +
AllProp.PropC * GetAReal!(CPtsZPg, PtNo) +
AllProp.PropD * GetAReal!(DPtsZPg, PtNO) + Disp.Z
Pt.x = ObjPathPosit.x - (PFac! * (Pt.x - ObjPathPosit.x)) Pt.y = ObjPathPosit.y - (PFac! * (Pt.y - ObjPathPosit.y)) Pt.Z = ObjPathPosit.Z - (PFac! * (Pt.Z - ObjPathPosit.Z)) SetArrayReal FastWorkArraylXPg + gBuildTOggle + 0, Ndx, Pt.x SetArrayReal FastWorkArraylXPg + gBuildTOggle + 1, Ndx, Pt.y SetArrayReal FastWorkArraylXPg + gBuildTOggle + 2, Ndx, Pt.Z
NEXT 'point along the seg END IF
END IF
NEXT' SetA FastWorkArraylXPg + gBuildTOggle, 0, Ndx **************************** Undraw previous buffer and draw new one DrawArray FastWorkArraylXPg + 3 - gBuildToggle, 0, False gBuildToggle = 3 - gBuildToggle DrawArray FastWorkArraylXPg + 3 - gSuildToggle, -1, False END SUB
SUB ShowGuideLn (WchPose) IF WchPose = 1 THEN ShowGuideLnPart2 BLns(), BPtsXPg, WchPose IF WchPose = 2 THEN ShowGuideLnPart2 ALns(), APtsXPg, WchPOSe IF WchPose = 3 THEN ShowGuideLnPart2 BLns(), BPtsXPg, WchPOSe IF WchPose = 4 THEN ShowGuideLnPart2 CLns(), CPtsXPg, WchPOSe END SUB
SUB ShowGuideLnPart2 (LnArray() AS Line Type, PtArray, WchPose) IF ALns(0).Beg <> 0 AND LnNo + 1 < ALns(0).Beg + 1 THEN
HiLiLn LnArray(), PtArray, LnNo + 1 END IF
END SUB
SUB ShowG~ideMatchPts (WchPOSe) IF WchPose = 1 THEN ShowGuideLnPart2 ALns(), APtsXPg, WchPOSe IF WchPose = 2 THEN ShowGuideLnPart2 BLns(), BPtsXPg, WchPOSe IF WchPose = 3 THfiN ShowGuideLnPart2 CL~s(), CPtsXPg, WchPOSe IF WchPose = 4 THEN ShowGuideLnPart2 DLns(), DPtsXPg, WchPose END SUB
SUB ShowLn (WchPOSe, LnNo, ShowColor) SELECT CASE WchPose GetStartFinish ALns(), LnNo, Start, Finish DrawPartialArray APtsXPg, Start, Finish, ShowColor, True GetStartFinish BLns(), LnNo, Start, Finish DrawPartialArray BPtsXPg, Start, Finish, ShowColor, True GetStartFinish CLns(), LnNo, Start, Finish DrawPartialArray CPtsXPg, Start, Finish, ShowColor, True GetStartFinish DLns(), LnNo, Start, Finish DrawPartialArray DPtsXPg, Start, Finish, ShowColor, True END SELECT
END SUB
SUB ShowObj (WchObject, WchPOSe) 'before lines turned into Begs FOR I = 1 TO NoOfLines IF ALns(I).WchObj = WchObject TI~1 ShowLn WchPose, I, -1 END IF
NEXT
END SUB
SUB ShowObjectSegs (aObj, aPose, aColor, aUSeLines) FOR I = 1 TO NoOfSegs IF FinlSgs(I).WchObj = aObj TI-~N
DrawPartialArray APtsXPg+3*(aPOSe-1), FinlSgs(I).Beg, FinlSgs(I).Fin, aColor, aUseLines END IF
NEXT
END SUB
SUB ShowObjOnPath (WchObj, Obj2, ObjPathPosit AS t3DPoint) DIM Pt AS t3DPoint ' Simplified to show only A Pose ZCorrection = 40 LensFocalLength = 35 NegZ! = ObjPathPOSit.Z / ZDivisor - ZCorrection PFac! = LensFocalLength / NegZ!
' *************************** Find total points to be drawn TotalPOints = 0 FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchObj = WchObj TF~N
TotalPoints = TotalPoints+FinlSgs(SegNo).Fin-FinlSgs(SegNo).Beg+1 END IF
NEXT
' *************************** Build up into toggled buffer area Ndx = 0 FOR SegNo = 1 TO NoOfSegs IF FinlSgs(SegNo).WchObj = WchObj TF~1 FOR PtNo = FinlSgs(SegNo).Beg TO FinlSgs(SegNo).Fin STEP INr(TotalPoints / 150) + 1 Ndx = Ndx + 1 Pt.x = GetAReal!(APtsXPg,PtNo)+ObjPathPosit.x-AObjCntr(WchObj).x Pt.y = GetAReal!(APtsYPg,PtNO)+ObjPathPosit.y-AObjCntr(WchObj).y Pt.Z = GetAReal!(APtsZPg,PtNo)+ObjPathPosit.Z-AObjCntr(WchObj).Z
Pt.x = ObjPathPosit.x - (PFac! * (Pt.x - ObjPathPOSit.x)) Pt.y = ObjPathPosit.y - (PFac! * (Pt.y - ObjPathPosit.y)) Pt.Z = ObjPathPosit.Z - (PFac! * (Pt.Z - ObjPathPosit.Z)) SetArrayReal FastWorkArraylXPg + gBuildToggle, Ndx, Pt.x SetArrayReal FastWorkArraylYPg + gBuildToggle, Ndx, Pt.y SetArrayReal FastWorkArraylZPg + gBuildToggle, Ndx, Pt.Z
NEXT 'point along the seg END IF
NEXT
SetA FastWorkArraylXPg + gBuildToggle, 0, Ndx ' **************************** Undraw previous buffer and draw new one DrawArray FastWorkArraylXPg + 3 - gBuildTOggle, 0, False gBuildToggle = 3 - gBuildToggle DrawArray FastWorkArraylXPg + 3 - gBuildToggle, -1, False END sUs SUB ShowObjPath (Array, Visibility) IF Visibility = 0 TF~NN LeftColor = 0: RightColor = 0 IF Visibility = 1 THEN LeftColor = LCol: RightColor = RCol FOR I = 1 TO NoOfFrames 'shows object path EyeDisp = GetAReal!(Array + 2, I) / ZDivisor CIRCLE (GetAReal!(Array, I) - EyeDisp, GetAReal!(Array + 1, I)), 2, LeftColor CIRCLE (GetAReal!(Array, I) + EyeDisp, GetAReal!(Array + 1, I)), 2, RightColor FOR J = 1 TO NoOfSortedSyncPts IF SortedS~ncPts(J).Frame = I THa~I
CIRCLE (GetAReal!(Array, I) - E~reDisp, GetAReal!(Array + 1, I)), 8, LeftColor CIRCLE (GetAReal!(Array, I) + ~reDisp, GetAReal!(Array + 1, I)), 8, RightColor END IF
NEXT
NEXT
END SUB
SUB ShowScaffold (WchPose) FOR I = 1 TO NoofScaffoldPts SELECT CASE WchPose x = AScaffoldCntr(1).x - ScaffoldDisp(I).x y = AScaffoldCntr(1).y - ScaffoldDisp(I).y Z = AScaffoldCntr(1).Z - ScaffoldDisp(I).Z

x = BScaffoldCntr(1).x - ScaffoldDisp(I).x y = BScaffoldCntr(1).y - ScaffoldDisp(I).y Z = BScaffoldCntr(1).Z - ScaffoldDisp(I).Z

x = CScaffoldCntr(1).x - ScaffoldDisp(I).x y = CScaffoldC~tr(1).y - ScaffoldDisp(I).y Z = CScaffoldCntr(1).Z - ScaffoldDisp(I).Z

x = DScaffoldCntr(1).x - ScaffoldDisp(I).x y = DScaffoldCntr(1).y - ScaffoldDisp(I).y Z = DScaffoldCntr(1).Z - ScaffoldDisp(I).Z
END SELECT
XYZ.x = x: XYZ.y = y: XYZ.Z = Z
Mrk 2, 1 NEXT
END SUB
SUB ShowSpaceRefPts FOR I = 1 TO SpaceRef(0).Visib XYZ = SpaceRef(I).Locat Mrk 2, 1 END SUB
SUB ShowS~mcPtLines (StartOfPresentS~ncPts) IF SyncPtIndex > 0 TF~N
FOR s = 1 TO StartOfPresentSyncPts + 1 XPos = 40 + Interval! * (syncpts(s).Frame - 1) LINE (XPos, 42)-(XPos, 349), 8 VerticalText syncpts(s).Label, 125, XPos NEXT
FOR s = StartOfPresentSyncPts + 1 TO SyncPtIndex XPos = 40 + Interval! * (syncpts(s).Frame - 1) LINE (XPos, 42)-(XPos, 349), 10 VerticalText syncpts(s).Label, 125, XPos NEXT
LOCATE 23, 1: PRINT "Vert Lines Show SyncPts Used Before -Mark Again If Wanted Again For This Path"
END IF
END SUB
SUB ShowWhllmage (WchPose, ShowColor) 'showln is only good before justify FOR I = 1 TO NoOfLines ShowLn WchPOSe, I, ShowColor NEXT
END SUB
SUB Smooth (Arrayl, Array2, SmoothRange, EvenS~acing) DIM Pt AS t3DPoint, Delta AS t3DPOint IF EvenSpacing TF~N
ArrayB = TempSmoothPtsXPg ' If spacing evenly, dest of part 1 is temp array ELSE
ArrayB = Array2 ' else dest of part 1 is output array END IF
PtLimit = GetA(Arrayl, 0) IF PtLimit < SmoothRange + 1 THEn1 SmoothRange = PtLimit - 1 IF SmoothRange < 0 THIN SmoothRange = 0 END IF
SetA ArrayB, 0, GetA(Arrayl, 0) TotalRange = 2 * SmoothRange + 1 ************************************************ X Values FOR I = 1 TO PtLimit Sum! = 0 FOR J = I - SmoothRange TO I + SmoothRange IF J < 1 Tf~N
K = 1 ELSE
IF J > PtLimit TF~NN
K = PtLimit ELSE
K = J
END IF
END IF
Sum! = Sum! + GetAReal!(Arrayl, K) NEXT J
SetArrayReal ArrayB, I, Sum! / TotalRange NEXT I
************************************************ y Values FOR I = 1 TO PtLimit Sum ! = 0 FOR J = I - SmoothRange TO I + SmoothRange IF J < 1 TF~1 K = 1 ELSE
IF J > PtLimit TF~1 K = PtLimit ELSE
K = J
END IF
END IF
Sum! = Sum! + GetAReal!(Arrayl + 1, K) NEXT J
SetArrayReal ArrayB + 1, I, Sum! / TotalRange NEXT I
. ************************************************ Z Values FOR I = 1 TO PtLimit Sum! = 0 FOR J = I - SmoothRange TO I + SmoothRange IF J < 1 TI~1 K = 1 ELSE
IF J > PtLimit TF~N
K = PtLimit ELSE
K = J
END IF
END IF
gum! = Sum! + GetAReal!(Arrayl + 2, K) NEXT J
SetArrayReal ArrayB + 2, I, Sum! / TotalRange NEXT I
*********************** Insert points for even segment lens IF EvenSpacing Tf~N
OutIndex = 0 ************* Find shortest line segment MinDist! = 1E+09 FOR I = 1 TO PtLimit - 1 Dist! = DistToNextPoint(ArrayB, I) IF Dist! < MinDist! TF~N MinDist! = Dist!
NEXT
IF MinDist! < 1! TF~N MinDist! = 1!
************* Copy to new array, inserting new points where needed FOR I = 1 TO PtLimit - 1 Pt.x = GetAReal!(ArrayB + 0, I) Pt.y = GetAReal!(ArrayB + 1, I) Pt.Z = GetAReal!(ArrayB + 2, I) OutIndex = Outlndex + 1 SetArrayReal Array2 + 0, Outlndex. Pt.x SetArrayReal Array2 + 1, OutIndex, Pt.y SetArrayReal Array2 + 2. OutIndex, Pt.Z
Dist! = DistToNextPoint(ArrayB, I) factor! = Dist! / MinDist!
IF factor! > 1.7 THEN
NumNewPoints = INT(factor! - .7) Delta.x = (GetAReal!(ArrayB+0, I+1) - GetAReal!(ArrayB+0, I)) 1 (NumNewPOints + 1) Delta.y = (GetAReal!(ArrayB+1, I+1) - GetAReal!(ArrayB+1, I)) /
(NumNewPoints + 1) Delta.Z = (GetAReal!(ArrayB+2, I+1) - GetAReal!(ArrayB+2, I)) /
(NumNewPoints + 1) FOR J = 1 TO NumNewPoints Outlndex = outIndex + 1 SetArrayReal Array2 + 0, OutIndex, Pt.x + J * Delta.x SetArrayReal Array2 + 1, OutIndex, Pt.y + J * Delta.y SetArrayReal Array2 + 2, OutIndex, Pt.Z + J * Delta.Z
NEXT
END IF
NEXT
SetA Array2, 0, OutIndex END IF
END SUB
SUB SmoothJoin (PtsToBeJoined, Range) DIM SmthJnPts(65) AS t3DPoint DIM SYnthJnPtsAA(65) AS t3DPoint NoOfPtsToBeJoined = GetA(PtsTOBeJoined, 0) J = 0 FOR I = Range TO 1 STEP -1 J = J + 1 SmthJnPts(J).x = GetAReal!(PtsTOBeJoined, I) SmthJnPts(J).y = GetAReal!(PtsTOBeJoined + 1, I) SmthJnPts(J).Z = GetAReal!(PtsToBeJoined + 2, I) NEXT
FOR I = NoOfPtsToBeJoined TO NoOfPtsTOBeJoined - Range STEP -1 J = J + 1 SmthJnPts(J).x = GetAReal!(PtsTOBeJoined, I) SmthJnPts(J).y = GetAReal!(PtsToBeJoined + 1, I) SmthJnPts(J).Z = GetAReal!(PtsToBeJoined + 2, I) NEXT
S~nthJnPts(0).x = J
OldSYnooth SmthJnPts(), ShithJnPtsAA(), 5 J- = 0 FOR I = Range TO 1 STEP -1 J = J + 1 SetArrayReal PtsToBeJoined, I, SmthJnPtsAA(J).x SetArrayReal PtsToBeJoined + 1, I, SmthJnPtsAA(J).y SetArrayReal PtsToBeJoined + 2, I, SmthJnPtsAA(J).Z
NEXT
FOR I = NoOfPtsToBeJoined TO NoOfPtsTOBeJoined - Range STEP -1 J = J + 1 SetArrayReal PtsToBeJoined, I, SmthJnPtsAA(J).x SetArrayReal PtsToBeJoined + 1, I, SmthJnPtsAA(J).y SetArrayReal PtsToBeJoined + 2, I, SmthJnPtsAA(J).Z
NEXT
END SUB
SUB SortSSmcPtsForApplic (Kind, WchNo) 'kind: 1=obj, 2=grp, 3=wxp 'this re-sorts sync pts for what obj or grp or wrp they are for, every time 'so index goes from one to noof syncpts for that obj or grp etc.
SortedSyncPts(1).Frame = 1 'this Mks first SortedSyncPts(syncpt) start of path SortedSyncPts(1).TempPtsIndex = 1 SortedSyncPts(1).Label = "StartFrm"

SortedSyncPtsIndex = 1 IF Kind = 1 THEN
SortedS~ncPts(1).WchObj = WchNo FOR G = 1 TO SyncPtIndex IF syncpts(G).WchObj = WchNo THEN
SortedSyncPtsIndex = SortedSyncPtslndex + 1 'first real SortedSyncPts is index 2 SortedSyncPts(SortedSyncPtsIndex).WchObj = WchNo SortedSyncPts(SortedSyncPtsIndex).Frame = syncpts(G).Frame SortedS~ncPts(SortedSyncPtsIndex).Label = syncpts(G).Label SortedSyncPts(SortedSyncPtsIndex).TempPtsIndex =
syncpts(G).TempPtsIndex END IF
NEXT
SortedSyncPts(SortedSyncPtsIndex + 1).WchObj = WchNo END IF
IF Kind = 2 THEN
SortedSyncPts(1).WchGrp = WchNo FOR G = 1 TO SyncPtIndex IF syncpts(G).WchGxp = WchNo THEN
SortedSyncPtsIndex = SortedSyncPtsIndex + 1 'first real SortedSyncPts is index 2 SortedSyncPts(SortedSyncPtsIndex).WchGrp = WchNo SortedSyncPts(SortedSyncPtsIndex).Frame = syncpts(G).Frame SortedS~rncPts(SortedSyncPtslndex).Label = syncpts(G).Label SortedSyncPts(SortedS~mcPtsIndex).Te~PtsIndex =
syncpts(G).TempPtsIndex END IF
NEXT
SortedS~mcPts(SortedSyncPtsIndex + 1).WchGrp = WchNo END IF
IF Kind = 3 THEN
SortedSyncPts(1).WchWrp = WchNo FOR G = 1 TO SyncPtIndex IF syncpts(G).WchWxp = wchNo THEN
SortedSyncPtsIndex = SortedSyncPtsIndex + 1 'first real SortedSyncPts is index 2 SortedSyncPts(SortedSyncPtsIndex).WchWrp = WchNo SortedSyncPts(SortedSyncPtsIndex).Frame = syncpts(G).Frame SortedSyncPts(SortedS~mcPtsIndex).Label = syncpts(G).Label SortedSyncPts(SortedSyncPtsIndex).TempPtsIndex =
syncpts(G).TempPtsIndex END IF
NEXT
SortedSyncPts(SortedSyncPtsIndex + 1).WchWrp = WchNo END IF
SortedSyncPts(SortedSyncPtslndex + 1). Frame = NoOfFrames 'this Mks last SortedSyncPts(syncpt) end of array SortedS~ncPts(SortedSyncPtsIndex + 1).TempPtsIndex = GetA(TempPtsXPg, 0) SortedS~ncPts(SortedSyncPtsIndex + 1).Label = ~EndFrm~
NoOfSortedSyncPts = SortedSyncPtsIndex + 1 END SUB
SUB Stretch (Small, Big, StartSmall, EndSmall, StartBig, EndBig) NoOfsrnall = EndSmall - StartSmall: NoOfBig = EndBig - StartBig IF NoOfSmall <> 0 AND NoOfBig <> 0 THEN
SetArrayReal Big, StartBig, GetAReal!(Small, StartSmall) SetArrayReal Big + 1, StartBig, GetAReal!(Small + 1, StartSmall) SetArrayReal Big + 2, StartBig, GetAReal!(Small + 2, StartSmall) SetArrayReal Big, EndBig, GetAReal!(Small, EndSmall) SetArrayReal Big + 1, EndBig, GetAReal!(Small + 1, EndSmall) SetArrayReal Big + 2, EndBig, GetAReal!(Small + 2, EndSmall) Ratio! _ (NoOfBig / NoOfSmall) END IF
LastBig = StartBig 'at the start only FOR I = Startsmall - StartSmall + 1 TO EndSmall - Startsmall - 1 BigNdx = CINT(StartBig + (I * Ratio!)) SetArrayReal Big, BigNdx, GetAReal!(Small, StartSmall + I) SetArrayReal Big + 1, BigNdx, GetAReal!(Small + 1, StartSmall + I) SetArrayReal Big + 2, BigNdx, GetAReal!(Small + 2, StartSmall + I) IF BigNdx > LastBig + 1 THEN Interpo Big, LastBig, BigNdx LastBig = BigNdx NEXT
IF EndBig > LastBig + 1 THEN Interpo Big, LastBig, EndBig END SUB
SUB SwapLineDirection WchPose = UserChoice("Swap Direction Of A Line In Which Pose?", ~~ A ~~ ~~ B ~~ ~~ C ~~ ~~ D ~~ ~~ ~~ ) CLS
LineNo = 0 DO
IF LineNo <> 0 THEN ShowFinalLn WchPose, LineNo, 0 LineNo = LineNo + 1 IF LineNo > NoOfLines THEN LineNo = 1 ShowFinalLn WchPose, LineNo, -1 LOOP WHILE NOT Confirm("This Line?") Index = 0 J = 0 Start = ALns(LineNo).FinalStart Finish = ALns(LineNo).FinalEnd FOR I = Start TO Finish J = J + 1 SetArrayReal TempPtsXPg, J, GetAReal!(APtsXPg + 3 * (WchPose - 1), I) SetArrayReal TempPtsYPg, J, GetAReal!(APtsYPg + 3 * (WchPose - 1), I) SetArrayReal TempPtsZPg, J, GetAReal!(APtsZPg + 3 * (WchPose - 1), I) EndTempPts = J
NEXT
FOR I = Finish TO Start STEP -1 Index = Index + 1 SetArrayReal APtsXPg + 3*(WChPose-1), I, GetAReal!(TempPtsXPg, Index) SetArrayReal APtsYPg + 3*(WChPose-1), I, GetAReal!(TempPtsYPg, Index) SetArrayReal APtsZPg + 3*(WchPose-1), I, GetAReal!(TempPtsZPg, Index) NEXT
I = LineNo ALns(I).Beg = ALns(I).FinalStart ALns(I).Fin = ALns(I).FinalEnd BLns(I).Beg = ALns(I).FinalStart BLns(I).Fin = ALns(I).FinalEnd CLns(I).Beg = ALns(I).FinalStart CLns(I).Fin = ALns(I).FinalEnd DLns(I).Beg = ALns(I).FinalStart DLns(I).Fin = ALns(I).FinalEnd END SUB
SUB SwapSortedSyncPts FOR I = 1 TO SortedSyncPtIndex - 1 FOR q = 1 TO SortedSyncPtIndex - I
IF SortedSyncPts(q).Frame > SortedSyncPts(q + 1). Frame THEN
SWAP SortedSyncPts(q).Frame, SortedSyncPts(q + 1). Frame SWAP SortedSyncPts(q).TempPtsIndex, SortedSyncPts(q + 1).TempPtsIndex SWAP SortedSyncPts(q).WchObj, SortedSyncPts(q + 1).WchObj SWAP SortedSyncPts(q).WchGrp, SortedSyncPts(q + 1).WchGrp SWAP SortedSyncPts(q).WchWrp, SortedSyncPts(q + 1).WchWrp 'CAN'T SWAP STRINGS in a type, APPARENTLY, THEREFORE:
LabelA$ = SortedSyncPts(q).Label LabelB$ = SortedSyncPts(q + 1). Label SortedSyncPts(q).Label = LabelB$
SortedSyncPts(q + 1). Label = LabelA$
END IF
NEXT
NEXT
END SUB
SUB TransPtr (FrameNo, WchGrp, AllProp AS TransType) SELECT CASE WchGrp CASE 1: AllProp = Transl(FrameNo) CASE 2: AllProp = Trans2(FrameNo) CASE 3: AllProp = Trans3(FrameNo) CASE 4: AllProp = Trans4(FrameNo) CASE 5: AllProp = TransS(FrameNo) END SELECT
END SUB
SUB TrnsfrATo (Array, ImageLns() AS LineType) FOR I = 0 TO GetA(APtsXPg, 0) SetArrayReal Array, I, GetAReal!(APtsXPg, I) SetArrayReal Array + 1, I, GetAReal!(APtsXPg + 1, I) SetArrayReal Array + 2, I, GetAReal!(APtsXPg + 2, I) NEXT
FOR I = 0 TO NoOfLines ImageLns(I).Beg = ALns(I).Beg ImageLns(I).Fin = ALns(I).Fin NEXT
SetA Array, 0, GetA(APtsXPg, 0) END SUB
SUB TrnsfrPath (aSourceArray, PathNo) TrnsfrWhlArray aSourceArray, PathlXPg + 3 * (PathNo - 1) END SUB
SUB TrnsfrPrevLineToIm (WchSource, DestinationPose, WchLine) SELECT CASE WchSource TrnsfrPrevLnToTempPts APtsXPg, ALns(WchLine).Beg, ALns(WchLine).Fin, WchSource, DestinationPose TrnsfrPrevLnToTempPts BPtsXPg, BLns(WchLine).Beg, BLns(WchLine).Fin, WchSource, DestinationPOSe TrnsfrPrevLnToTempPts CPtsXPg, CLns(WchLine).Beg, CLns(WchLine).Fin, WchSource, DestinationPose END SELECT
END SUB
SUB TrnsfrPrevLnTOTempPts (Array, Start, Finish, WchSource, DestinationPose) DIM shift AS t3DPoint shift.x = ImDrawingCentrDisp(DestinationPose).x TmnrawingCentrDisp(WchSource).x shift y = ImDrawingCentrDisp(DestinationPose).y -ImDrawingCentrDisp(WchSource).y shift.Z = ImDrawingCentrDisp(DestinationPose).Z -ImDrawingCentrDisp(WchSource).Z
J = 0 FOR I = Start TO Finish J = J + 1 SetArrayReal TempPtsXPg, J, (GetAReal!(Array, I) + shift. x) SetArrayReal TempPtsYPg, J, (GetAReal!(Array + 1, I) + shif t y) SetArrayReal TempPtsZPg, J, (GetAReal!(Array + 2, I) + shift. Z) NEXT
SetA TempPtsXPg, 0, J
END SUB
SUB TrnsfrProp (Array() AS TransType, NoOfVals) FOR I = 1 TO NoOfVals Array(I).PropA = TransGrfVal(I).PropA
Array(I).PropB = TransGrfVal(I).PropB
Array(I).PropC = TransGrfVal(I).PropC
Array(I).PropD = TransGrfVal(I).PropD
NEXT
END SUB
SUB TrnsfrTmpToImPartA (WchPose) IF WchPose = 1 THa1 TrnsfrTmpToImPartB APtsXPg IF WchPose = 2 TF~NN TrnsfrTmpToImPartB BPtsXPg IF WchPose = 3 THEN TrnsfrTmpToImPartB CPtsXPg IF WchPose = 4 THEN TrnsfrTmpToImPartB DPtsXPg LdLnLnArrays WchPose, Col END SUB
SUB TrnsfrTmpToImPartB (PtArray) FOR I = 1 TO GetA(TempPtsXPg, 0)'i=1 to end of temppts J = I + GetA(PtArray, 0) 'j=i+end of previous line in this Pose SetArrayReal PtArray, J, GetAReal!(TempPtsXPg, I) SetArrayReal PtArray + 1, J, GetAReal!(TempPtsXPg + 1, I) SetArrayReal PtArray + 2, J, GetAReal!(TempPtsXPg + 2, I) NEXT
SetA PtArray, 0, J 'this sets end of Apts, Bets etc. to new end END SUB
SUB TrnsfrWarp (Array() AS WarpProfileType, NoOfVals) FOR I = 1 TO NoOfVals Array(I).Proportion = GetAReal(RawPtsXPg, I) NEXT
SetArrayReal RawPtsXPg, 0, NoOfVals END SUB
SUB TrnsfrWave (WaveNo) SELECT CASE WaveNo TrnsfrWhlArray FastWorkArray2XPg, JAPtsXPg TrnsfrWhlArray FastWorkArray2XPg, JBPtsXPg TrnsfrVyhlArray FastWorkArray2XPg, JCPtsXPg TrnsfrVJhlArray FastVdorkArray2XPg, JDPtsXPg END SELECT
END SUB
SUB TrnsfrWhlArray (Arrayl, Array2) Elements = GetA(Arrayl, 0) Source = Arrayl Dest = Array2 FOR I = 1 TO Elements SetArrayReal Dest, I, GetAReal!(Source, I) NEXT
SetA Dest, 0, Elements Source = Arrayl + 1 Dest = Array2 + 1 FOR I = 1 TO Elements SetArrayReal Dest, I, GetAReal!(Source, I) NEXT' Source = Arrayl + 2 Dest = Array2 + 2 FOR I = 1 TO Elements SetArrayReal Dest, I, GetAReal!(Source, I) END SUB
FUNCTION UserChoice(Text$, C$, D$, A$, B$, E$) ErsMnu LOCATE 2, 1:
PRINT Text$

IF A$ <> "
" TF~N

LOCATE 1, 3 PRINT A$

LINE (MBXVals(1),0)-(MBXVals(2),13), 5, B

END IF

IF B$ <> "
" Tf~N

LOCATE 1, 19 PRINT B$

LINE (MBXVals(3),0)-(MBXVals(4),13), 5, B

END IF

IF C$ <> "
" Tf~N

LOCATE 1, 35 PRINT C$

LINE (I~XVals(5),0)-(I~XVals(6),13), 5, B

END IF

IF D$ <> "" THEN

LOCATE 1, 51 PRINT D$

LINE (MBXVals(7), 0)-(MBXVals(8),13), 5, B

END IF

IF E$ <> ~~ ~~

LOCATE 1, 67 PRINT E$

LINE (MBXVals(9), 0)-(MBXVals(10),13), 5, B

END IF

Done = False WHILE Done = False WndIn CalcFlatXY

CalcMrkrPts ShowFlatCrsr IF XYZ.y > 0 AND XYZ.y < 16 THIN

SELECT CASE XYZ.x CASE MBXVals(1) TO MBXVals(2):Done = True: UserChoice = 1 CASE MBXVals(3) TO MBXVals(4):Done = True: UserChoice = 2 CASE MBXVals(5) TO MBXVals(6):Done = True: UserChoice = 3 CASE MBXVals(7) TO MBXVals(8):Done = True: UserChoice = 4 CASE MBXVals(9) TO MBXVals(10): Done = True: UserChoice = 5 END SELECT

END IF

WEND
MyDelay 1 ErsMnu END FUNCTION

SUB Velcro VelcroNo = 0 DO
VelcroNo = VelcroNo + 1 A$ = Group(1).Label: B$ = Group(2).Label C$ = Group(3).Label: D$ = Group(4).Label: E$ = Group(5).Label VelcroAGrp(VelcroNo).GrpWithHook =
UserChoice("4Jhich Group is Master?", Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, Group(5).Label) CLS
ShowGrp 1, VelcroAGrp(VelcroNo).GrpWithHook, -1 RightGrp = False DO
LOCATE 1, 1 Text$ _ "Mrk Point On A Master Group Line To Which Handle Of Slave Group Is To Stick"
FindMrkdPtInAPose ThisOne, Text$
WchSeg = FindWchFinlSg(FinlSgs(), ThisOne) WchFoundGrp = FinlSgs(WchSeg).WchGrp IF WchFoundGrp = VelcroAGrp(VelcroNo).GrpWithHook THEN
VelcroAGrp(VelcroNo).HookPtIndex = ThisOne RightGrp = True ELSE
Mrk 1, 1 END IF
LOOP UNTIL RightGrp = True SlaveGrpOK = False DO WHILE NOT SlaveGrpOK

VelcroAGrp(VelcroNo).SlaveGrp =
UserChoice("Which Group is Slave?", Group(1).Label, Group(2).Label, Group(3).Label, Group(4).Label, Group(5).Label) IF Group(VelcroAGrp(VelcroNo).SlaveGrp).WchObj =
Group(VelcroAGrp(VelcroNo).GrpWithHook).WchObj THEN
SlaveGrpOK = True ELSE
LOCATE 3, 1: PRINT "Doesn't Belong To Same Object. ReDo"

LOCATE 3, 1: PRINT SPACE$(60) END IF
LOOP
LOOP WHILE Confirm("Velcro More Groups?") NoOfVelcros = VelcroNo END SUB
SUB VerticalText (Text$, y, x) VertTextLocat = CINT(y / 14) HorTextLocat = INT(x / 8) FOR I = 1 TO LEN(Text$) Letter$ = MID$(Text$, I, 1) IF VertTextLocat > 0 AND VertTextLocat < 23 AND
HorTextLocat > 0 AND HorTextLocat < 81 THEN
LOCATE VertTextLocat + 1, HorTextLocat + 1 PRINT Letter$
END IF
VertTextLocat = VertTextLocat + 1 NEXT
END SUB
SUB VisInvisObj ChooseObj RefObject, "Which Object?"
INPUT "Object Appears At Frame"; Object(RefObject).StartVis INPUT "Object Disappears At Frame"; Object(RefObject).EndVis END SUB
SUB WaitForClick WHILE INP(889) >= 128: WEND
WHILE INP(889) < 128: WEND
END SUB
SUB WarpSegPathArrayPositPtr (FrameNo, WchPath, WarpSegPathPtPosit AS t3DPoint) WarpSegPathPtPosit.x = GetAReal!(PathlXPg + 3*(WchPath-1), FrameNO) WarpSegPathPtPosit.y = GetAReal!(PathlYPg + 3*(WchPath-1), FrameNo) WarpSegPathPtPosit.Z = GetAReal!(PathlZPg + 3*(WchPath-1), FrameNo) END SUB
FUNCTION WarpSegProfPtr! (WchProf, WhereInProf) SELECT CASE WchProf CASE 1: WarpSegProfPtr! = Profilel(WhereInProf).Proportion CASE 2: WarpSegProfPtr! = Profile2(WhereInProf).Proportion CASE 3: WarpSegProfPtr! = Profile3(WhereInProf).Proportion CASE 4: WarpSegProfPtr! = Profile4(VJhereInProf).Proportion CASE 5: WarpSegProfPtr! = Profile5(WhereInProf).Proportion CASE 6: WarpSegProfPtr! = Profile6(WhereInProf).Proportion CASE 7: WarpSegProfPtr! = Profile?(WhereInProf).Proportion CASE 8: WarpSegProfPtr! = Profile8(WhereInProf).Proportion CASE 9: WarpSegProfPtr! = Profile9(WhereInProf).Proportion END SELECT
END FUNCTION
SUB WarpSegWaveShapePtr (PositionNo, WchWave, WarpSegWaveDisp AS t3bPoint) SELECT CASE WchWave WarpSegWaveDisp.x = GetAReal!(JAPtsXPg, PositionNo) WarpSegWaveDisp.y = GetAReal!(JAPtsYPg, PositionNo) WarpSegWaveDisp.Z = GetAReal!(JAPtsZPg, PositionNo) WarpSegWaveDisp.x = GetAReal!(JBPtsXPg, PositionNo) WarpSegWaveDisp.y = GetAReal!(JBPtsYPg, PositionNo) WarpSegWaveDisp.Z = GetAReal!(JBPtsZPg, PositionNo) WarpSegWaveDisp.x = GetAReal!(JCPtsXPg, PositionNo) WarpSegWaveDisp.y = GetAReal!(JCPtsYPg, PositionNo) WarpSegWaveDisp.Z = GetAReal!(JCPtsZPg, PositionNo) WarpSegWaveDisp.x = GetAReal!(JDPtsXPg, PositionNo) WarpSegWaveDisp.y = GetAReal!(JDPtsYPg, PositionNo) WarpSegWaveDisp.Z = GetAReal!(JDPtsZPg, PositionNo) END SELECT
END SUB
SUB WndChs (Text$, A$, B$, C$, D$, E$, Ans$, When) ErsMnu WndMnu Text, A$, B$, C$, D$, E$
IF When = 0 THEN WndSlct Ans$, 1 END SUB
SUB WndIn 'minus moves cursor away from viewer DIM Location AS WandReportType ReadWand Location 'XYZ switches are becuz of wand transmitter mounting only XYZ.x = 320! + (-Location.y / XLeverage) + XAdjust - 50 XYZ.y = 320! - (ABS(Location.Z) / YLeverage) + YAdjust - 50 XYZ.Z = -Location.x / ZLeverage + ZAdjust + Zoom!
IF ZFixed = True THEN XYZ.Z = 0 END SUB
SUB WndMnu (Text$, A$, B$, C$, D$, E$) LOCATE 2, 1: PRINT Text$
IF A$ <> "x" THEN
LOCATE 1, 3 PRINT A$
LINE (MBXVals(1), 0)-(MBXVals(2), 13), 5, B
END IF
IF B$ <> "x" TF~N
LOCATE 1, 19 PRINT B$
LINE (MBXVals(3), 0)-(MBXVals(4), 13), 5, B
END IF
IF C$ <> "x" THEN
LOCATE 1, 35 PRINT C$
LINE (MBXVals(5), 0)-(MBXVals(6), 13), 5, B

END IF
IF D$ <> "X" THEN
LOCATE 1, 51 PRINT D$
LINE (MBXVals(7), 0)-(MBXVals(8), 13), 5, B
END IF
IF E$ <> "x" THEN
LOCATE 1, 67 PRINT E$
LINE (MBXVals(9), 0)-(MBXVals(10), 13), 5, B
END IF
END SUB
SUB WndPtScan (object, Object2, Group, Group2, Array, Limit, MarkType, ScanForWhat) NoMarker = False: Frtnsnd = False LOCATE 23, 28: PRINT "BACK"
LOCATE 23, 38: PRINT "STATIC"
LOCATE 23, 49: PRINT "FORWARD"
LINE (0, 340)-(639, 340), 8 LINE (0, 349)-(639, 349), 8 LINE (300, 340)-(300, 349), 8 LINE (346, 340)-(346, 349), 8 LOCATE 1, 1 SELECT CASE ScanForWhat CASE eScanTransOnTempGraph speed = 0 PRINT "Scan ACTION Created By Action Control Graph (click to exit)"
LOCATE 22, 38: PRINT "TempPt": LOCATE 22, 60 PRINT "TOtaIPtS"; Limit CASE eObjPathOnTempPts speed = 0 PRINT "Scan Object's MOVEMENT OVER PATH IN SPACE (click to exit)"
NoMarker = True LOCATE 22, 38 PRINT "TempPt"
LOCATE 22, 60 PRINT "TotalPts"; Limit CASE eObj PathByFrttis speed = 0 Frmsnd = True PRINT "Scan Object's MOVEMENT OVER PATH IN SPACE BY FRAMES
(click to exit)"
NoMarker = True LOCATE 22, 38 PRINT "FRAME"
LOCATE 22, 60 PRINT "TotalFrms"; Limit CASE eScanForWarpByFrms speed = 0 PRINT "Scan Warp BY FRAMES (click to exit)"
LOCATE 22, 38 PRINT "FRAME"
CASE eScanTransByFrms speed = 0 Frmsnd = True PRINT "Scan ACTION ONLY By FRAMES (click to exit)"
LOCATE 22, 38 PRINT "FRAME"
LOCATE 22, 60 PRINT "TotalFims"; Limit CASE eScanGrpTransPlusPath speed = 0 Frmsnd = True PRINT "Scan ACTION PLUS MOVEMENT OVER PATH IN SPACE BY FRAMES
(click to exit)"
NoMarker = True LOCATE 22, 38 PRINT "FRAME"
LOCATE 22, 60 PRINT "TotalFrms"; Limit CASE eScanForObjPathSyncPt speed = 500 PRINT "Define Object Path SYNC PT -Click To Mark"
LOCATE 22, 38 PRINT "TempPt"
IACATE 22, 60 PRINT "TotalPts"; Limit CASE eScanFozTransSyncPt speed = 500 PRINT "Define Action Control Graph SYNC PT -Click To Mark"
LOCATE 22, 38 PRINT "TempPt"
LOCATE 22, 60 PRINT "TotalPts"; Limit CASE eScanForWarpSyncPt speed = 500 PRINT "Define Warp SYNC PT -Click To Mark"
LOCATE 22, 38 PRINT "TempPt"
LOCATE 22, 60 PRINT "TotalPts"; Limit CASE eScanForReferenceObject speed = 200 PRINT "Scan Over Frames To Locate Reference Object\Group -Click To Select Frame"
LOCATE 22, 38 PRINT "FRAME"
LOCATE 22, 60 PRINT "TotalFrms"; Limit CASE eScanForAnchorPts speed = 1000 PRINT "Define ANCHOR PT (Click To Mark)"
LOCATE 22, 38 PRINT "FRAME"
LOCATE 22, 60 PRINT "TotalFrms"; Limit END SELECT
LastDelayedScanIndex = 1 STATIC ScanIndex 'LOCATE 2, 1: PRINT "Click To Mark Or Exit"
m WndIn XYZ.y = 342: XYZ.Z = 0 ShowFlatCrsr Change = INT(XYZ.x / 50) - 6 Scanlndex = Scanlndex + Change IF ScanIndex < 1 THEN ScanIndex = Limit IF ScanIndex > Limit THEN ScanIndex = 1 LOCATE 22, 44: PRINT ScanIndex; " "

XYZ.x = GetAReal!(Array, ScanIndex) XYZ.y = GetAReal!(Array + 1, ScanIndex) XYZ.Z = GetAReal!(Array + 2, ScanIndex) IF NoMarker = False THEN Mrk MarkType, 1 SELECT CASE ScanForWhat CASE eObjPathOnTempPts ShowObjOnPath Object, Obj2, XYZ
CASE eObjPathByFrms ShowObjOnPath Object, Obj2, XYZ
CASE eScanForWarpByFrms LACATE 4, 1 PRINT "Visual not implemented"
CASE eScanTransOnTempGraph ShowGroupTScript Group, Group2, ScanIndex, "Temp"
CASE eScanTransByFrms ShowGroupTScript Group, Group2, ScanIndex, "Frames"
CASE eScanForObjPath55rncPt ShowObjOnPath Object, Obj2, XYZ
CASE eScanForTransSyncPt ShowGroupTScript Group, Group2, ScanIndex, "Temp"
CASE eScanForWarpS~ncPt LOCATE 4, 1 PRINT "not implemented"
CASE eScanGrpTransPlusPath ShowGrpTransInPathPOSit Object, Group, Group2, ScanIndex CASE eScanForReferenceObject ShowGrpTransInPathPosit Object, Group, Group2, ScanIndex CASE eScanForAnchorPts ShowGrpTransInPathPosit Object, Group, Group2, ScanIndex END SELECT
counter = 0 DO WHILE counter < speed counter = counter + 1 FOR I = 1 TO 500: NEXT
LOOP
IF NoMarker = False THEN Mrk MarkType, 1 IF INP(889) < 128 THEN
IF ScanForWhat = eScanForAnchorPts THEN BEEP
FoundIt = True ThisOne = Scanlndex ReferenceFrame = Scanlndex Mrk 3, 1 EXIT DO
END IF
LOOP
END SUB
SUB WndSlct (Ans$, Delay) Ans$ _ "zilch"
DO
WndIn CalcFlatXY
CalcMrkrPts ShowFlatCrsr DO UNTIL INP(889) >= 128 LOOP
SELECT CASE XYZ.y SELECT CASE XYZ.x CASE 1~XSTals(1) TO MBXVals(2): Ans$ = A$: EXIT DO
CASE I48XVals(3) TO MBXVals(4): Ans$ = B$: EXIT DO
CASE MBXVals(5) TO I48XVals(6): Ans$ = C$: EXIT DO
CASE MaXVals(7) TO MBXVals(8): Ans$ = D$: EXIT DO
CASE MBXVals(9) TO l~XVals(10): Ans$ = E$: EXIT DO
CASE ELSE: EXIT DO
END SELECT
END SELECT
LOOP
IF Delay = 1 TF~N MyDelay 1 END SUB
SUB WriteXFerInfo (C, P, x!, y!, Z!) Transferlnfo.Cmd = C
TransferInfo.Param = P
Transferlnfo.x = x!
Transferlnfo.y = y!
Transferlnfo.Z = Z!
PUT #2, , TransferInfo END SUB
FUNCTION XYZDiff STATIC LastXYZ AS t3DPoint XYZDiff = (XYZ.x <> LastXYZ.x) OR
(XYZ.y <> LastXYZ.y) OR
(XYZ.Z <> LastXYZ.Z) LastXYZ = XYZ
END FUNCTION

Claims (23)

I CLAIM:
1. In a computer animation system, a process for creating animation drawings for use in an animation sequence depicting a transformation of an object, the process comprising:

selecting a plurality of source poses for said object, each said source pose comprising a predetermined form of said object, defining a pose transformation space dependent upon the number of said selected source poses, assigning each said source pose to a point within said pose transformation space, traversing a path within said pose transformation space using a computer input device, said computer selecting a plurality of points along said path, calculating, for each said selected point, the distance to each of said source pose points, generating, for each said selected point, a corresponding constructed pose, said constructed pose comprised of a composite of said source poses, wherein the contribution of each said source pose is determined by its distance to said selected point, and storing said constructed pose for use in an animation drawing.
2. The process of claim 1 wherein said pose transformation space is two-dimensional.
3. The process of claim 1 wherein said pose transformation space is three-dimensional.
4. The process of claim 1 wherein said pose transformation space is six-dimensional.
5. The process of claim 1 further comprising monitoring the rate of motion of said input device and using said rate to control the rate of change of an animation sequence comprising a transformation of the form of said object utilizing a plurality of said constructed poses.
6. The process of claim 1 further comprising displaying said constructed pose concurrently with said drawing of said path.
7. The process of claim 2 wherein said pose transformation space is a polygon and said source poses are assigned to vertices of said polygon.
8. The process of claim 3 wherein said pose transformation space is a polyhedron.
9. The process of claim 5 further comprising displaying a velocity profile for said motion of said input device, said velocity profile comprising a graphical representation of said rate of change of said animation during said transformation of said object.
10. The process of claim 6 wherein each said constructed pose is displayed substantially at the same time said input device traverses the point corresponding to said constructed pose.
11. The process of claim 7 wherein said pose transformation space is a triangle.
12. The process of claim 8 wherein said pose transformation space is substantially the shape of a tetrahedron and one source pose is assigned to each of the four vertices of said tetrahedron.
13. The process of claim 9 further comprising modifying said displayed velocity profile using said input device to adjust said rate of change of said animation sequence.
14. The process of claim 12 further comprising monitoring the rate of motion of said input device and using said rate to control the rate of change of an animation sequence comprising a transformation of the form of said object utilizing a plurality of said constructed poses.
15. The process of claim 14 further comprising displaying a velocity profile for said motion of said input device, said velocity profile comprising a graphical representation of said rate of change of said animation during said transformation of said object.
16. The process of claim 15 further comprising modifying said displayed velocity profile using said input device to adjust said rate of change of said animation sequence.
17. The process of claim 1 wherein said selected points are equally spaced in time in accordance with a predetermined, fixed time interval.
18. The process of claim 1 wherein said contribution of each said source pose is inversely proportional to its distance to said selected point.
19. The process of claim 5 wherein each said constructed pose is used in a frame of animation in said animation sequence.
20. The process of claim 14 wherein each said constructed pose is used in a frame of animation in said animation sequence.
21. The process of claim 5 wherein said rate of change of said animation sequence is directly proportional to said rate of motion of said input device.
22. The process of claim 14 wherein said rate of change of said animation sequence is directly proportional to said rate of motion of said input device.
23. A computer animation system for creating animation drawings for use in an animation sequence depicting a transformation of an object comprising:

means for storing a plurality of source poses for an object for use in an animation sequence for said object, each said source pose comprising a predetermined form of said object, means for defining a pose transformation space dependent upon the number of said stored source poses, means for assigning each said source pose to a point within said pose transformation space, means for traversing a path within said pose transformation space using a computer input device, said computer selecting a plurality of points along said path, means for calculating, for each said selected point, the distance to each of said source pose points, means for generating, for each said selected point, a corresponding constructed pose, said constructed pose comprised of a composite of said source poses, wherein the contribution of each said source pose is determined by its distance to said selected point, and means for storing said constructed pose for use in an animation drawing.
CA002241854A 1995-12-26 1996-12-24 Computer-assisted animation construction system and method and user interface Expired - Fee Related CA2241854C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CA002483943A CA2483943C (en) 1995-12-26 1996-12-24 Computer-assisted animation construction system and method and user interface

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US08/578,293 1995-12-26
US08/578,293 US5854634A (en) 1995-12-26 1995-12-26 Computer-assisted animation construction system using source poses within a pose transformation space
PCT/CA1996/000881 WO1997024696A2 (en) 1995-12-26 1996-12-24 Computer-assisted animation construction system and method and user interface

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CA002483943A Division CA2483943C (en) 1995-12-26 1996-12-24 Computer-assisted animation construction system and method and user interface

Publications (2)

Publication Number Publication Date
CA2241854A1 CA2241854A1 (en) 1997-07-10
CA2241854C true CA2241854C (en) 2005-12-13

Family

ID=35517629

Family Applications (1)

Application Number Title Priority Date Filing Date
CA002241854A Expired - Fee Related CA2241854C (en) 1995-12-26 1996-12-24 Computer-assisted animation construction system and method and user interface

Country Status (1)

Country Link
CA (1) CA2241854C (en)

Also Published As

Publication number Publication date
CA2241854A1 (en) 1997-07-10

Similar Documents

Publication Publication Date Title
US5854634A (en) Computer-assisted animation construction system using source poses within a pose transformation space
Agrawala et al. Artistic multiprojection rendering
US20240007605A1 (en) Apparatus and method for performing motion capture using a random pattern on capture surfaces
US5561745A (en) Computer graphics for animation by time-sequenced textures
US6559849B1 (en) Animation of linear items
Parke Computer generated animation of faces
US6097396A (en) Method and apparatus for creating lifelike digital representation of hair and other fine-grained images
JP4555722B2 (en) 3D image generator
US5696892A (en) Method and apparatus for providing animation in a three-dimensional computer generated virtual world using a succession of textures derived from temporally related source images
US7068277B2 (en) System and method for animating a digital facial model
CA2241854C (en) Computer-assisted animation construction system and method and user interface
CA2483943C (en) Computer-assisted animation construction system and method and user interface
Magnenat-Thalmann et al. Special cinematographic effects with virtual movie cameras
Booth et al. Computers: Computers animate films and video: Computers permit spectacular visual effects and take the drudgery out of film cartooning
Qi et al. Quasi-3D cell-based Animation.
Klein An image-based framework for animated non-photorealistic rendering
Di Fiore et al. Highly stylised drawn animation
Funk Animac. Analog 3D Animation
Ban et al. High-definition digital display case with the image-based interaction
Munzner Artistic Multiprojection Rendering
DI FIORE School of Information Technology
Magnenat Thalmann et al. Computer animation in future technologies
Joel A conceptual model for computer animation

Legal Events

Date Code Title Description
EEER Examination request
MKLA Lapsed

Effective date: 20141224