Coder Social home page Coder Social logo

ofxpoint's Introduction

ofxPoint

This is an Openframeworks addon.

Description

a template for ofVec3f

Types: typedef ofxPoint_ ofxPoint;

typedef ofxPoint_<int> 				ofxIntPoint;
typedef ofxPoint_<char> 			ofxCharPoint;
typedef ofxPoint_<unsigned char> 	ofxUCharPoint;
typedef ofxPoint_<short> 			ofxShortPoint;
typedef ofxPoint_<unsigned short> 	ofxUShortPoint;
typedef ofxPoint_<int> 				ofxIntPoint;
typedef ofxPoint_<unsigned int> 	ofxUIntPoint;
typedef ofxPoint_<long> 			ofxLongPoint;
typedef ofxPoint_<unsigned long> 	ofxULongPoint;
typedef ofxPoint_<float> 			ofxFloatPoint;
typedef ofxPoint_<double> 			ofxDoublePoint;

Usage

ofxPoint is float by default.

example code:

// declare
ofxPoint		float3d;
ofxIntPoint		int3d;
ofxUCharPoint	uchar3d;
ofxDoublePoint	double3d;
	
//scalars
ofxIntPoint anIntpoint1(3);
ofxIntPoint anIntpoint3(3.4445f);
ofxIntPoint anIntpoint5('a');

//ctor same type
ofxIntPoint anIntpoint4(int3d);

//ctor other types
ofxIntPoint anIntpoint6(uchar3d);
ofxIntPoint anIntpoint7(double3d);
ofxIntPoint anIntpoint2(float3d);
ofVec3f ofVec1(float3d);
ofVec3f ofVec3(double3d);

// operators work across types
ofVec3f		ofVec_;
double3d = double3d + ofVec_;

// ofVec3f receiving ofxPoint types
ofVec_ = float3d + ofVec_;
ofVec_ = float3d;
ofVec_2 = double3d;
ofVec3f ofVec1(float3d);
ofVec3f ofVec2(double3d);

// printing like in ofVec3f
cout << float3d << endl;
cout << int3d << endl;
cout << uchar3d << endl;
cout << double3d << endl;

ofxpoint's People

Contributors

jordiexvision avatar

Stargazers

2bit avatar Christopher Baker avatar

Watchers

James Cloos avatar Jordi Puig 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.