lookat parameter for gridshape
Hello!
I'm trying to create a lookat parameter for a jit.gl.multiple because apparently, the parameter doesn't exist.
I'm trying to creat one with jit.expr, but my gridshapes don't converge
Maybe there is another way to do it.
ok, so there is improvement, but there is a problem with negative values
any help ?
`
Done !
I cheated a bit a the end because I was being sick of doing trigonometry.
Anyway it works :)
Please tell me if there is a better way:)
By your description, I don't understand your intent. The lookat parameter doesn't make sense in jit.gl.multiple, jit.gl.gridshape or any other "object". It makes sense in jit.gl.render (where you define the OpenGL camera) or better yet, in jit.gl.camera (Max 6).
I guess I'm not understanding what you're trying to accomplish... I'm certain I'm missing something.
Anyway, here it goes, a clarification of the lookat message. Good luck.
I want many objects to look a particular point,
I'm using trigonometry in order to find the angle between any of my multiple object and a particular mooving target, I tested the patch again, it seems to work.
Lookat is avaliable for cameras and lights but not for gridshapes .
Not behind the computer but you can plug a jit.anim.node into an object and then send it the lookat co-ordinates eg. lookat 0. 0. 0.
You maybe have to turn locklook to 1 for it to work.
This won't work because all the the duplicated objects will look in a parallel direction as the original object. I want an effect of convergeance.
Not sure if your right there. If all the objects are at different points in 3d space and they're all told to look at 0. 0. 0. then they should all look independently.
Then again not behind my computer with Max so I can't check your patch.
Cool idea! Not necessarily better, but I took the liberty of porting your jit.exprs into a single jit.gen object
jit.gl.multiple cannot be used in conjunction with jit.anim.node. it will simply modify the original object, and therefore every object will have the same rotation.
cool patch nicolas, glad you figured out a solution using the maths.
I want to make big mooving eyes that follows people beyond the screen mouahahaha !!
By the way, thanks for optimising my patch, jit.expr is usefill but quite heavy!
In my project, I use a shader (a controllable mask) and a texture that are automatically applied to the -x face of the cubes.
In the above patch, the z face is orienting it self to the target, I want the -x face to lookat the moving cube.
If I use a rotation on my gridshape, it will change the disposition (position) of all my cubes because of the "position" glparams of my jit.gl.multiple.
Is it possible to rotatexyz a gridshape without changing the axes, without cheating with a pass to jit.gl.mesh (because it's being complicated to transmit a shader and a mapped texture) in order to change the face that look at my target?
Nicolas