Forums > MaxMSP

jit.gl.mesh sphere backward?

March 27, 2014 | 1:35 pm

Hi there, I’m following Masato Tsutsui video to make visuals work with audio, however when I get the sphere on the window, it’s backwards…like I have to drag the sphere around to actually view the interesting part of the visuals, I’ve done everything the same as Tsutsui. Does Anyone know why?

 

 

– Pasted Max Patch, click to expand. –

 

 


March 28, 2014 | 3:52 am

I see nothing technically wrong with your patch. Instead, this is an artistic choice.

The default location for the "camera" viewing your scene is 0,0,2 (x,y,z coordinated) and looking towards 0,0,0.
The default location for the sphere you are drawing (via gl.mesh) is position 0,0,0.
The default rotation for the sphere (drawn via gl.mesh) is no rotation on any axis.
Finally, the manner in which the vertices of the sphere is defined by gl.gridshape is to drawn the vertices as if you were looking down at the "north pole" of the Earth.

So…that means that in this patch, by default, you are looking at the north pole of the sphere from your camera at 0,0,2. The algorithms of the mic, catch, slide, op,… they are manipulating the vertices…but in a way that is more artistically interesting if you view the sphere at the "equator" and not the "north pole".

The quickest solution to view the equator? Add an additional param to your jit.gl.mesh: @rotatexyz -90 0 0
This will cause the mesh to rotate -90 degrees on the X axis.

And if you want to "pull back" so you can see more of the sphere in your window, you could put the following param on your gi.render: @camera 0 0 3
This causes your camera to move back one unit on the Z axis allowing you to see more of the sphere.

There are so very very many ways to move around your objects, spheres, camera, etc. The above is only one way.


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