Code Monkey home page Code Monkey logo

queasycam's Introduction


NOTE: THIS PROJECT IS NO LONGER ACTIVELY MAINTAINED. I'LL LEAVE IT UNARCHIVED SO THAT PEOPLE CAN CREATE AND COMMENT ON ISSUES WITH EACH OTHER, BUT I DON'T PLAN TO MAKE ANY MORE CHANGES TO IT ANY TIME SOON. THANKS!


QueasyCam is a super-simple first-person-shooter camera for 3D Processing sketches. It steals its name and its desired ease of use from PeasyCam. A QueasyCam camera can be controlled using the mouse and WASD keys (as well as Q and E for upward and downward motion).

Here's an example. Setting the camera speed and sensitivity are optional.

import queasycam.*;

QueasyCam cam;

void setup(){
	size(400, 400, P3D);
	cam = new QueasyCam(this);
	cam.speed = 5;              // default is 3
	cam.sensitivity = 0.5;      // default is 2
}

void draw(){
	background(0);
	box(200);
}

API

Here's the full API.

controllable = a boolean that lets you turn on / off the mouse / keyboard controls

speed = a float value that represents the speed coefficient of the camera

velocity = a 3D PVector that represents the direction and magnitude of movement of the camera in space

sensitivity = a float value that represents the mouse sensitivity coefficient of the camera

position = a 3D PVector that represents the position of the camera

pan = a float value that represents the rotation of the camera around the vertical axis

tilt = a float value that represents the rotation of the camera around the horizontal axis

friction = a float value that represents how much the camera slides as it moves around

getForward() = returns the forward-pointing PVector of the camera

getRight() = returns the rightward-pointing PVector of the camera

queasycam's People

Contributors

jrc03c avatar sabhay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

queasycam's Issues

can't look down easily

When I look up the mouse moves to the bottom this is normal but when I look down the mouse gets stuck at the bottom. Any Help?

tilt and pan should be public

In order to calculate facing direction (e.g. to render held objects in front of the camera, throw, shoot, etc.) the QueasyCam class needs to make pan and tilt public. They are currently marked private, so nothing can be known about the player view -- only the player position.

Need help with Queasy Cam Positioning

I have this code here:

import queasycam.*;
float x = 0;
float y = 0.5;
float z = 0;
QueasyCam cam;

void setup()
{
size(1390, 1000, P3D);
cam = new QueasyCam(this);
cam.speed = 3;
cam.sensitivity = 1;
cam.position = new PVector(x, y, z);
}
void Gravity()
{
if (cam.position(x, y>1.5, z));
{
y -= 1;
}
}
void Ground()
{ box(1000, 0.5, 1000); }
void draw()
{
background(0);
Ground();
}

And I am trying to make it so that when you jump the QueasyCam's position will go to a certain point and then drop you back down to create a gravity-like effect. I can make the jump but the gravity is what I am struggling with. PVectors is somewhat confusing to me and I am wondering why this will not work.

Customise keyboard controls?

I have no idea if this is still active but would it be possible to add a way of customising the keyboard? I want to have it so that space is up and shift is down but I don't know how that would be done.

Cannot use the HUD

I can't figure out how to use the heads up display.
I put beginHUD();
and the i put in the code i want to display then
i put endHUD();
but i just get errors.

Comments in Maze Example

I need to add some comments in the maze example to show the inheritance of variables like position in the Player class. (from this PR)

Fix the `getUp()` function

The getUp() function simply returns the up variable, which does not represent the actual upward-pointing vector of the camera. Instead, the actual upward-pointing vector needs to be calculated on the fly and returned.

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.