3d coordinate to sphere normalized coordinates (jit.gen)

michelez's icon

Hello jitter ninjas,

I am trying to convert a point 3d coordinate into a pair of x and y normalized coordinate to use in jit.gen to map that point onto a sphere. The point that I am generating is always going to be on the sphere but I don't know where on the sphere it is going to be. I need to find the specific point by converting its 3d coordinate into a single x-y matrix coordinate pair to then map it onto a sphere into jit.gen.
I got pretty close to the solution using [atan2] but the points are still somewhat apart. please take a look at the attached patch which should be clearer that this explanation.

Max Patch
Copy patch and select New From Clipboard in Max.

MakePatchesNotWar's icon

Hey,

I could be totally mistaken here but if i understand correctly i think you want to project a point onto a sphere?

hth

Max Patch
Copy patch and select New From Clipboard in Max.

michelez's icon

Hey,

Thank you for you answer. Though that is not what I was trying to do. I attached the solution to that problem courtesy of Rajan Craveri from the FB Jitter group.
If I may, I now have a different issue to solve: I want to create a texture that I can map on a grid shape using @tex_map 2 (sphere). I do I transform a cartesian coordinate into a coordinate for @tex_map 2?

Max Patch
Copy patch and select New From Clipboard in Max.

MakePatchesNotWar's icon

Oof, no idea. Hope someone else chimes in...

I assume you'd have to look at billboarding textures?

michelez's icon

I haven't looked at billboarding textures... where?

MakePatchesNotWar's icon

Sorry, im really short on time atm but the concept of billboarding was introduced by Federico Foderaro's video, unfortunately his patch wasn't freely available so i couldn't/can't check but it's widely documented if you google it albeit all examples are done in gl and not really math-centric in explaining it.

Maybe message support? Texmap 2 as an option is not documented (in 6 at least), maybe they can give a clue what it's really doing behind the scenes?

https://www.youtube.com/watch?v=tUAAltGNTaI