iiki_cif@uhura.cc.rochester.edu (Ike Ikizyan ) (05/05/90)
I recently became interested in Mathematica graphics programming and have been trying to write a simulation package. To start off with, I want to simulate the geometry of the divergence of a vector field by showing the perturbations which a cube residing on a flow line undergoes while moving along the flow line through the parameter t for time. (that was a mouthful). The problem is that Mathematica doesn't want to evaluate my block and come up with the graphics. To start things off, I just want to draw the flow line which this cube is to have one of its vertices sitting on during the simulation. You're probably wondering how this is all going to work. Well I hope to generate a series of graphics screens stored in different variables and then show them in rapic succession using the Animation.m package. What I want to know is why the following code doesn't want to produce any graphics. It just gives me a block and does not evaluate it. I would appreciate it if someone would take a look at the short code below and tell me a few pointers to get it working. I must admit that I'm only a freshman in the electrical engineering major. You gotta' admit, we were all virgins at once. I'm really interested in computer graphics and image processing and the like, but using Bezier polynomials for generating spline curves fresh out of high school is not the easiest of tasks. Here's the code so far: (** Written by Ike Ikizyan, Copyright 1990 **) (** The 3-d graphics involving the geometry of divergence in terms of **) (** a parallelepiped undergoing perturbations due to divergence of field **) BeginPackage["DivPlot3D`"] Needs["Animation`"] Needs["ParametricPlot3D`"] DivPlot3D::usage = "DivPlot3D[{x,y,z},{x0,y0,z0},{t,t0,t1},n,options...] will show the parallelepiped as it moves along the path in n number of still shots." Begin["`Private`"] plotpoints = PlotPoints /. Options[Plot3D]; (* default *) Attributes[DivPlot3D] = {HoldFirst}; DivPlot3D[{f1_,f2_,f3_}, {x0_, y0_, z0_}, {t_, t0_, t1_}, n_, opts___] := Block[{x=x0,y=y0,z=z0} SpaceCurve[{f1,f2,f3},{t,t0,t1,0.15},BoxRatios->{1,1,1}] ] End[] EndPackage[] ========================================================================== Please excuse my reticence. It's just that I hesitate before I articulate on a subject so dubious to my mental capacity fearing that I might deviate from the lines of rectitude and right. -Ike Ikizyan iiki_cif@uhura.cc.rochester.edu UNIVERSITY of ROCHESTER