Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ofVec2f and ofPoint

I'm learning Openframeworks and have found that these two classes are often used to represent sometimes vectors and sometimes points. What are the reasons for using one over the other?

like image 921
Julian Avatar asked Jan 28 '26 19:01

Julian


1 Answers

An ofPoint is in fact just an ofVec3f. It is defined like this:

typedef ofVec3f ofPoint;

(See here for the code)

I think it's just a question of convenience. When you want to represent a point in a 3-dimensional space, it's more explicit to use an ofPoint than an ofVec3f and it makes your code more readable.

like image 106
Elie Génard Avatar answered Jan 31 '26 10:01

Elie Génard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!