Forums > Gen

How to plunge my vector & points distance calculations into gen for efficiency ?

June 10, 2012 | 9:47 am

Hi there,
diving in GenExpr with jit.gen for better efficiency.
Even with, I’m a bit lost.

As dtr suggested here:, I’d like to use jit.gen for a (basic) calculation.

I have my vector coming from my cam view (position, orientation) & a point (position).
I need to calculate elevation and azimuth relatively to my cam vector (indeed, a & e vary according to the orientation of cam)

anyone would help me with this apparently easy stuff with gen ?

swiz seems to be the key.
but considering a matrix 1,3 (my vector, basically), how can I explode its values to x y & z variables to use them in a codebox inside gen …?

ANY leads/helps would save my hour =)

June 11, 2012 | 4:40 am

Hi Julien,
Are you calculating just a single result or do you have a matrix of positions that you’re calculating? If it’s a matrix on input positions, I would set things up as follows:

[param position] // cam position
[param orientation] cam orientation
[in 1] // positions to calculate a/e data relative to camera

If you have a patch, even if it doesn’t work, but shows the data you’re working with, that would help immensely.

June 11, 2012 | 7:21 am

Hi wesley, answered to that finally, being quite related.

May I ask you your opinions about the last post I just made ?
My system needs to be a bit optimized, even at this point.
Any help from you would be appreciate :)

Viewing 3 posts - 1 through 3 (of 3 total)