The example on this page attempts to show, not just how to create an image in FriCAS but also how to use it with other programs.
I wanted to make the image on the right to illustrate the topology of projective space discussed on this page.
We can use FriCAS to generate a parametric surface.
In this case, for all x,y then z=x*y
We can do this by using the following SPAD code:
|This code generates the 3D surface and also a 2D grid which we can use to texture the surface.||
)expose SCartesian )expose SArgand )expose SConformal )expose SceneIFS )expose SceneNamedPoints )expose STransform )expose SBoundary )expose ExportXml DF ==> DoubleFloat PT ==> SCartesian(3) xyfn(x:DF,y:DF):DF == x*y view := boxBoundary(sipnt(0,-500)$PT,sipnt(1200,500)$PT) sc := createSceneRoot(view)$Scene(PT) tr2 := addSceneTransform(sc,identity()$STransform(PT))$Scene(PT) gd := addPlot2Din3D(tr2,xyfn,-1..1,-1..1,49)$Scene(PT) writeX3d(sc,"projectiveSpace.x3d") PT ==> SArgand view2 := boxBoundary(sipnt(0,-500)$PT,sipnt(1200,500)$PT) sc := createSceneRoot(view2)$Scene(PT) gd := addSceneGrid(sc,view2)$Scene(PT) writeSvg(sc,"grid.svg")
First we use a program called Inkscape to convert the grid from a SVG file to a PNG file. (that is convert from a vector format to a raster format)
export it as grid.png
We now import this into Blender and do the following:
|Start blender and remove default cube|
|select camera view|
|import projectiveSpace.x3d file|
|rotate shape so we can see the corners starting to move together.|
|Now select the object and add material to it|
|remove spectial effects|
|select material and add texture|
|create new image and animation|
|open (not new) file: grid.png|
in Render tab
Set alpha channel