# FieldTrip

### From HaskellWiki

m (→FieldTrip for Animation using OpenGL: "less" --> "fewer") |
(Overhauled / simplified) |
||

Line 1: | Line 1: | ||

− | [[Category: | + | [[Category:Graphics]] |

+ | [[Category:Packages]] | ||

− | + | == Abstract == | |

− | + | ||

− | It is | + | '''FieldTrip''' is a library for functional 3D graphics. |

+ | It is intended as an API for building static, animated, and interactive 3D geometry, efficient enough | ||

+ | for real-time synthesis and display. | ||

+ | Our first renderer uses OpenGL, with the usual visual limitations. | ||

+ | Since FieldTrip is functional, it is about ''being'' rather than ''doing''. | ||

+ | One describes what models are, not how to render them. | ||

− | + | Besides this wiki page, here are more ways to find out about FieldTrip: | |

+ | * Read [http://code.haskell.org/FieldTrip/doc/html/ the library documentation]. | ||

+ | * Get the code repository: '''<tt>darcs get http://code.haskell.org/FieldTrip</tt>'''. | ||

+ | * Install from [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FieldTrip Hackage]. | ||

+ | * See the [[FieldTrip/Versions| version history]]. | ||

− | + | Please leave comments at the [[Talk:FieldTrip|Talk page]]. | |

− | + | == Basic types == | |

− | + | ||

− | + | ||

− | + | ||

− | + | The basic purpose of the core FieldTrip library is to allow a user build 3D geometry, from individual simple shapes to full 3D scenes. The principal types are as follows. | |

− | + | ||

− | + | ||

− | + | ||

− | < | + | ; <hask>Geometry3</hask> |

− | + | : 3D geometry. These values can be spatially transformed in space (affinely: scale, rotate, translate) and combined (union). | |

− | </ | + | ; <hask>Surf a = (a,a) -> (a,a,a)</hask> |

+ | : Parametric surfaces, i.e., mappings from 2D to 3D. Normals are constructed automatically and exactly via derivatives, thanks to the [[vector-space]] library. These normals are used for shading. For simplicity and composability, ''surfaces are curved'', not faceted. Surface ''rendering'' tessellates adaptively, caching tessellations in an efficient, infinite data structure for efficient reuse. The mechanism for choosing tessellation is a very primitive placeholder. FieldTrip provides some basic shapes of surfaces (spheres, torus, cubes, etc) and many functions for manipulating surfaces, colors, etc. | ||

− | < | + | ; <hask>Geometry2</hask> |

− | + | : 2D geometry. There's a <hask>flatG</hask> function to embed 2D into 3D. | |

− | + | ||

− | </ | + | ; <hask>Image o = (R,R) -> o</hask> |

+ | : A primitive placeholder for functional imagery in the spirit of [http://conal.net/Pan Pan]. The intention is to use this type or something like it for texture mapping. Much design and implementation work to be done. | ||

− | + | == FieldTrip meets Reactive == | |

− | + | FieldTrip contains no support for animation, because we envision it being used with the [[Reactive]] [[FRP] (functional reactive programming) library (and possibly other animation frameworks). | |

− | + | By design, FieldTrip is completely orthogonal to any formulation or implementation of FRP. | |

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + |

## Revision as of 18:26, 31 October 2008

## 1 Abstract

**FieldTrip** is a library for functional 3D graphics.
It is intended as an API for building static, animated, and interactive 3D geometry, efficient enough
for real-time synthesis and display.
Our first renderer uses OpenGL, with the usual visual limitations.
Since FieldTrip is functional, it is about *being* rather than *doing*.
One describes what models are, not how to render them.

Besides this wiki page, here are more ways to find out about FieldTrip:

- Read the library documentation.
- Get the code repository:
.`darcs get http://code.haskell.org/FieldTrip` - Install from Hackage.
- See the version history.

Please leave comments at the Talk page.

## 2 Basic types

The basic purpose of the core FieldTrip library is to allow a user build 3D geometry, from individual simple shapes to full 3D scenes. The principal types are as follows.

- Geometry3
- 3D geometry. These values can be spatially transformed in space (affinely: scale, rotate, translate) and combined (union).

- Surf a = (a,a) -> (a,a,a)
- Parametric surfaces, i.e., mappings from 2D to 3D. Normals are constructed automatically and exactly via derivatives, thanks to the vector-space library. These normals are used for shading. For simplicity and composability,
*surfaces are curved*, not faceted. Surface*rendering*tessellates adaptively, caching tessellations in an efficient, infinite data structure for efficient reuse. The mechanism for choosing tessellation is a very primitive placeholder. FieldTrip provides some basic shapes of surfaces (spheres, torus, cubes, etc) and many functions for manipulating surfaces, colors, etc.

- Geometry2
- 2D geometry. There's a function to embed 2D into 3D.flatG

- Image o = (R,R) -> o
- A primitive placeholder for functional imagery in the spirit of Pan. The intention is to use this type or something like it for texture mapping. Much design and implementation work to be done.

## 3 FieldTrip meets Reactive

FieldTrip contains no support for animation, because we envision it being used with the Reactive [[FRP] (functional reactive programming) library (and possibly other animation frameworks). By design, FieldTrip is completely orthogonal to any formulation or implementation of FRP.