We have proposed and implemented function-based extensions of X3D and its predecessor VRML which allow for defining time-dependent geometric shapes, their appearance and transformations with analytically defined parametric, implicit and explicit functions. The function-defined shapes can be used together with the standard X3D and VRML shapes. Besides defining shapes by analytical functions, we have developed interactive function-based shape modeling tools. We have also extended these interactive shape modeling tools to work on the Grid. Function-defined models can be efficiently rendered at the Media Grid Portal.