Git Product home page Git Product logo

parametric's Introduction

parametric

Experiment of creating GPU based parametric surfaces

Prerequisites:

CMake 2.8 or later for makefile generation OpenSceneGraph-3.4 or later

To compile:

cd parametric cmake . make

To run:

Using a single Z_FNCTION for both top and bottom surfaces, using z==0.0 to distinguish between the two

    apps/parametric --rows 100 --columns 100 --shader shaders/parametric.vert --shader shaders/parametric.frag --cone 1 0.5 0 1.0 2.9 --all --Z_FUNCTION "(x, y, z) ((z==0.0?-1.0 : 1.0)*((x-x*x)*(y-y*y)*5.0))" -d -b

Using Z_BASE and Z_TOP to provide separate functions for bottom and top surfaces

    apps/parametric --rows 100 --columns 100 --shader shaders/parametric.vert --shader shaders/parametric.frag --cone 1 0.5 0 1.0 2.9 --all --Z_BASE "(x, y, z) (-0.1*sin(x*y*6.28))"  --Z_TOP "(x,y,z) ((x-x*x)*(y-y*y)*5.0)" -b -d

Using the osg_SimulationTime uniform provided by the OSG to animate the bottom and top surfaces functions

    apps/parametric --rows 100 --columns 100 --shader shaders/parametric.vert --shader shaders/parametric.frag --cylinder 0.5 0.5 0.5 0.4 2.2 --all --Z_BASE "(x, y, z) (-0.1*sin(x*y*6.28+osg_SimulationTime))"  --Z_TOP "(x,y,z) ((x-x*x)*(y-y*y)*5.0+0.2*sin(osg_SimulationTime))" -b -d

parametric's People

Contributors

cesiumsolutions avatar robertosfield avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.