position texture on sphere?

karl krach's icon

hello,
i have a sphere with a camera inside. now i want to project a video on the inner wall opposing my camera. how would i do that?
because if i just apply the video onto my sphere, it wraps it all around it - but i just need it on one half of the sphere (or even less).

my first approach was to build a second, very large, empty texture on the cpu integrating my video layer in it via usedestdim. this worked but is really really slow.

i then tried this approach here https://cycling74.com/forums/positioning-texture-on-a-sphere/ but this is way beyond my mathematical capabilities and i do not understand at all what happens when switching into these linear projection modes...

the closest i got was with this https://cycling74.com/forums/scale-and-position-for-jit-gl-texture/ - i do get the two textures (an empty one and my video layer) combined but as soon as i try to move the video layer beyond the upper left quarter of the base texture, i only get weired garbeld stuff (maybe my textures are too big? how do i figure out how big a texture actually is?).

is there a simpler way to do this? as said, i actually just need to position/scale my video texture onto this sphere...

any help is appreciated a lot!!!
karl

karl krach's icon

update: here is the patch to the third approach (subtexture)... i simplified it so it does not map to a sphere but only tries to place a video layer unscaled and centered into a larger (empty) texture.
to me this seems like a bug since with really small textures (like 512x512) it works but with anything bigger it just produces garbeled stuff as soon as i move the video layer out of the upper left corner.

and anyway, isn't there a simpler way to do this? like just some scaling attribute to my video-texture wich would work after the texture has been mapped to a sphere? (i know there actually is a scaling attribute but this did not do anything for me in this context).

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

any help is greatly appreciated!!!
k

karl krach's icon

and just to make it complete: this is the (simplified) patch with my original problem.
to the left in the camera section you will see which area of the sphere is in the camera view. there (and only there) i need the video overlay (not stretched to the area behind the camera)...

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

anyone able to help?
k

karl krach's icon

sorry, another update: i think i solved it. not with one of the approaches above but with the help of the td.rota.jxs shader. that one does the job well and is easy to use...
best
k

karl krach's icon

um... ok, forget everything above.
after doing some other stuff i went back to this and unfortunately the rota shader is not an option since because of the scaling, the image quality is getting too low.
so i guess i really need some way to control the scale/position of the mapped texture on the sphere itself... how would i do this?

i attached a new, uncluttered patch which shows what i want to achieve...

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

can anyone help?
thanks a lot and best!
k

karl krach's icon

ok, sorry, i solved it.
i had another look at TexCoordMagic (first post, first link) and finally managed to work it out. it's really confusing at first and i had to setup my 3d-space anew but now it works, yay!
k