Suggestions/Corrections for Graphics3d.df
Change to G3dShape.DoWithFacingPolygons
take inverse: Matrix as an argument
Fix the awful kluge in G3dControlImpl.mesa
hint: ParameterizeIncrementalTransform.ExtractRotate.Asin.SqRt bombs occasionally
The following packages are not yet ported:
Needed by G3dRender:
ConvertRasterObject
ImagerFullColorContext, ImagerGrayContext, ImagerColorMap, ImagerSmoothContext
The following interfaces are insufficiently documented:
G3dBuild
G3dLighting
G3dSweep
The following source files are inconsistently named:
G3dBezierFromPolyProcs.mesa
G3dPatchFromPolyProcs.mesa
G3dStandardPatchProcs.mesa
The following changes are proposed:
G3dBasic.df:
G3dBasic
add RealSequenceFromList (from BioMuscleImpl)
G3dDraw
eliminate ImagerCGContext calls if ever Imager is updated to use CG6
G3dClip: Implement Clipped and Polygon (Jules has some c-code from his UCSC course).
G3dSpline:
InflectionPoint is undoubtedly wrong (Stone and DeRose: may be 2 inflection points).
NearestSpline: cf new Sederberg paper.
Change IntersectSplineAndPlane to accdept G3dPlane.Plane?
G3dModel.df:
Pt/Normal/Attribute/Poly Editor
G3dNavigateImpl is all commented, why?
For Modeling program: TYPE ~ ModelModificationRegistrationProc;
Add to G3dModel procs in G3dModelCmdsImpl.mesa
Implement G3dModel.ShapeFromPoints;
G3dTube.mesa:
eliminate tube.next?
introduce continuity/bias to tube?
redo control panel
Bug in interpolating contours: inordinate number computed around t = 0.5
Do tapered test for normals when computing f.contour (instead of in TubeMisc.Points and TubeDisplay.DrawNormals.
Better documentation on Refmatrix: why z aligned with the tangent? Or why is triad aligned with tangent (because a cross sectional plane therefore is in the xy plane).
G3dRender.df:
G3dRender: On next interface change, make OutCode to a PACKED type.
Many unbounds in G3dRenderPackage
It would be handy to have something like:
PolygonSortOrder: TYPE ~ {backToFront, frontToBack};
SortPolygons: PROC [
vertices: G3dBasic.VertexSequence,
polygons: G3dBasic.SurfaceSequence,
polygonProc: G3dPolygon.PolygonProc,
order: {PolygonSortOrder} ← backToFront,
transformation: G3dMatrix.Matrix ← NIL];
Sort the polygons according to order, calling polygonProc for each polygon, in order.
Transform the vertices if transformation # NIL.
Will not work for cyclically overlapping or intersecting polygons?
The sorting code exists already; could it be rewritten to supports the above?
Then, create G3dDraw.DrawPolygons: for each poly, create Imager trajectory of entier poly (fill with background), back-facing edges (draw dashed color), and other edges (draw solid color).
G3dShadeImpl:
illuminationProc is not assigned soon enough to individual light sources;
try the Lights menu in 3dView and setting an infinite light source; then bug Render
G3dMappedAndSolidTexture:
Make MakeTxtrCoordsFromNormals not require a context!
Replace G3dRender.AntiAliasing needed with FilteringNeeded (from G3dRenderToolBImpl)
Storage leaks with Context3d
If you make and IP file from the color display showing a hidden line rendering, it's upside down (from Maureen Stone)
There is an easy hack to give spotlights, by dotting a light aim direction with the direction from the light to the object sample, and raising that to a suitable power. It's similar to traditional specular highlights, i.e. i = MAX[0, cos q]focus, where focus determines how focused the spot will be. An easy way to allow this is to add a LightRep.focus: REAL ← 0. When focus=0, you should get an unfocussed light (mathematically true, but also worth a special check in the code because of the MAX). I'm assuming LightRep.highlight can be used for aiming, but I don't really know what it's supposed to mean. You can add LightRep.aim: Triple ← [-0.8164966, -0.4082483, -0.4082483] if necessary.
Finally, one of the biggest loopholes you can leave for future hackers is to include an optional procedure which answers the question: "If I put a surface with (small) area dA at position x with respect to this light, what emission spectrum will I see?" (The surface is understood to be oriented perpendicular to the light, of course; and it's an area so we can anti-alias.) If the procedure ain't there, life goes on as usual. If it is there, you can do theatre lights with barndoors, headlights with non-uniform intensity distribution, local lights, colors that vary with viewing angle, area sources that give penumbra, or something that nobody's even thought of yet. I figure that's an excellent return on investment: one REF for ultimate generality
G3dScene.df:
Unbounds in G3dScenePackage (G3dBuild and G3dScene)
G3dUser.df:
G3dArcBallImpl: change cursor and/or put outline around B/C button?
Strange upward translation of an object; compare 3dView 3dTest.shape with 3dView 3dTest.shape -noArcBalls
G3dRenderTool: the sprite used should, maybe, be imaged something like:
[Artwork node; type 'Artwork on' to command tool]
G3dTransform/Compose <out> ← <in1> <transform(s)1> ... <inN> <transform(s)N>
G3dPolygonProxCmdImpl.mesa: use XOR when drawing the vector and asterisk.
G3dInterpret: include a WriteToLog (see FileInterpreter)
3dTool:
Resolve infinite vs. local lights (is there, in fact, a difference?)
Read scene parameters from a viewer fails to read descriptions generated by write parameters (naming conventions not agreed to)
Default shininess should be, oh, 30 (not 0)
No CR on fs error in 3dTool
Render in normal-mode (4 bits x, 4 bits y)
If matrix.hasPerspective, then
p0 ← TransformPolygonCenter
p1 ← TransformPolygonCenter+Normal
visible iff p1.z < p0.z (how does frank do this?) -- solved?
Face normals look real short (try with 3dSqTri.shape)
3dInterpret:
Poor error messages from StatementInterpreter
Bad function arg, e.g. ViewPort["Hi"], give unhelpful message like AMTypesYouLose
Bad function name, e.g. RealFns.Junk, give unhelpful message like "selection failed".
Error messages should include the position of the offending source line.
Viewer displays camera path.
If mouse down near camera path, update view according to point on path selected.
3dLighting:
Should always open in the color display; upon opening should reset its color map
Need: program to display the octree graph
Need: program to report potential polygon problems:
two-sided polygon
colinear polygon
non-convex polygon
non-planar polygon
polygon vertex out of range (exactly what would that mean?)
Write a program to print totals of the above anomalies:
5 colinear polygons, numbers: 1, 17, 19, 20, 21
153 non-convex polygons, numbers: 1,2,3,4,5,6,7,8,9,10, etc.
G3dPlot
G3dGraphCmd from Andrew: STOP button (guarded)
Camera controls (maybe, but if problems with arbitrary views, we can live without)
The ability to plot in both directions
Hidden line elimination on/off
AutoCenterScale button
Axes display on/off
Replace nSteps with nXSamples, nYSamples
MakeTool to return ToolData, so client can replace height data with new function.
G3dVolume.df:
G3dOctree: minimize NEW in ReadFromFile.Subdivision
ThreeDWorld.df:
Obvious transition from highlighted to non-highlighted polygons.
Setting texture scale when uv's aren't present causes MappedAndSolidTexture.ScaleTxtrCoords to blow up (fixed?).
Polygon sorting:
with simple polygon sorter:
Run "3dAnimate 3dSqTri.anim" to see a little film loop of the two shapes rotating. This shows clearly that frame 2 is bad.
with fancy polygon sorter:
Run "3dAnimate 3dTest2.anim" to see the rotation loop with this sorter. Frame 2 again has bad sorting, but frame 6 blows up.
Vertex colors are [0..8] not [0..1] ? banana and soccerball use [0..1] but sqtri.shape has to use a color value of 8 to get white. Why? Is it a model bug (such as lighting), a 3dvizer bug, or a threedworld bug?
ambient = 1 doesn't give white (1.5 does, apparently).
3dSqTriT.shape behaves as follows:
LerpTiler  anti off, shininess 0, texture off    ok
ShinyTiler anti off, shininess 100 or texture    too bright -- BUGGY
FancyTiler anti on, shininess on or off, texture on or off ok
If add a texture map to model without uv's, MappedAndSolidTexture.AdjustTexture dies trying to access a field of txtr, which is NIL. Need error with a mnemonic explanation.
U and V are interpolated wrong! They're interpolated linearly, not as rational linear functions, as they should be; textures in perspective appear rubber-like when animated.
Polygon tiling glitches. Black horizontal glitches at the bottom of polygons sometimes. Don't have a simple test file.
No way to re-render a specified screen window of an image so that the viewport mapping stays unchanged but only a subwindow of the screen is rerendered (for debugging a portion of the picture). Viewport[] changes the viewport mapping, Window[] maps the specified window to fill the viewport -- neither is what I want.
Bad Sorting!
Standard sorter: From certain angles, sqtri.shape is drawn with wrong depth ordering. Run "3danimate badsort1.anim" to witness.
Fancy sorter: default sorter is simple-minded. Use fancy sorter as shown in Frank's NewThreeDTest.cm:
SceneUtilities.ForcePrioritySort[context3d];
But this doesn't fix sort bug, sometimes it blows up. Try "3danimate badsort2.anim"
Can't get unfiltered textures with antialiasing off to work right. This combination goes into ShinyTiler, which renders too bright as mentioned above. On "3dvizer sqtrip.shape / read texture: man64.ais / render" you can see the texture in the lsb with a random colormap, but the shading is somehow bad. I think the excessive brightness is independent of texture mapping, however. It looks like a general ShinyTiler bug. Figured out 8/14. You need shininess>0, smooth, with the right magic on shape.fixedProps
shape: REF ShapeInstance, not shapeName should be the arguments to SceneUtilities procs.
SceneUtilities.ShapeFromData:
colors should be REF TripleSequence (otherwise, difficult to interface with file format).
Why need shape name to set bounding sphere in Render?
Shape.surface shouldn't be REF ANY-- unsafe! why not shape.polys, shape.patches, etc?
Shading type should be a separate field in the ShapeInstance and default to smooth, rather than be a part of the property list.
Separate Lights from Shapes so that procedures such as setting light sources, take a Light, not a Shape. How does one know if a shape is a light or an object?
Naming Conventions
Context -> Context3D!!!!!!
HiddenLines -> VisibleLines
SurfaceRender.GetBoundingSphere -> SetBoundingSphere
SceneUtilities.SetView causes an error, ThreeDBasics.SetView doesn't.
Documentation!!
Explain the functioning of ContextProc, ImagerProc.
Context3d.stopMe = REF BOOLEAN ??!!