Coder Social home page Coder Social logo

spherecamera's Introduction

A 3d camera class for Processing to control an inward pointing camera with zenith and azimuth angles instead of cartesian coords.

The movement is damped so you set the targets, not the actual angles like so...

sCam.camAzimuthTarget = random(-85,85);
sCam.camZenithTarget = random(0,360);
sCam.camSphereRadiusTarget = random(400)+500;
sCam.camTargTarget = random(1,10);

And it will make it's way there.  

To slow down or speed up the movement you use the integer passed in to the drawCamera() method in the render loop.  Lower numbers are faster.

sCam.drawCamera(64);

The targTarget is the cartesian coords of what the camera is pointing at but only accepts one number and adjusts X, Y and Z all at once which is a bit crap but I never really ever used it to do anything but slightly adjust the view so never got round to making it a full coord.

The boolean 'handheld' set to true will add a small amount of 3d perlin noise to the target to simulate the slight wobble you get with hand held cameras.

The sCam.axis() method called in the render loop will draw an XYZ axis at 0,0,0 cartesian to give you a starting point.

spherecamera's People

Stargazers

Corey Gouker avatar Jimmy avatar Pete Prodoehl avatar Stefan Goodchild avatar

Watchers

Stefan Goodchild 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.