Visual interfaces are very important for human interactions in cyberworlds. Visual spatio-temporal querying should be one of the basic tools for data mining and retrieval in cyberworlds. In this paper, we propose a novel function-based query model for arbitrary shape spatio-temporal querying. The queries are defined as geometric shapes changing over time. In our model, data are interpreted geometrically as multidimensional points with time dimension or as moving points. The queries are formulated with geometric objects and operations over them to form the query solid changing over time. The proposed query model allows us to pose arbitrary shape spatio-temporal range queries. With the uniform geometric model we integrate visual mining and querying of time-dependent data employing 3D visualization tools. It allows for creating an intuitive visual interface using 2D projections of 3D query shapes. Our approach combines visualization of spatio-temporal data with visualization of the range query formulation employing very compact function-based query model. The implemented visual query system and its visual interface are proposed and described. An example of application of the system in analysis of simulation results in molecular dynamics is considered.