Projects a PVector onto camera

Hello! in three.js exist a function calls Projects (onto a camera):

.project ( camera : Camera ) : this

camera — camera to use in the projection.

project: function ( camera ) {

		return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );

	},

Projects the vector with the camera.

anybody know the maths to do something similar in processing?

Just to make sure I’m clear – do you want to know how to do this in Processing(Java), or in p5.js?

Hi! i want to know how to do this in processing

I’m not seeing Camera.project in the three.js documentation, so I’m not totally clear on what the function does – three.js docs – can you link to the documentation?

Edit – found it: Vector3.project(): three.js docs

and

I think perhaps you should look at the reference

and specifically the Camera section functions and the Matrix functions, such as:

Is your question related to this?

See also PMatrix3D.invert:

https://forum.processing.org/one/topic/matrix-invert.html

http://processing.github.io/processing-javadocs/core/processing/core/PMatrix3D.html#invert--

1 Like