Hello everyone, I want to create a 360 VR experience, where the particles are moving around the user.
I want to use a 360 projection of a audio visualization top I’ve created. So that the particles move based on the visual, similar to optical flow technique but in 3D.
Does anyone know how this would be possibly achived?
Thanks in advance!
Hey @johncaraj,
in a VR setup as you describe it, your camera is positioned in the center of a sphere that has the visualization mapped onto it. The particles will be flying somewhere between the camera and that sphere. Now to use the visualization that is mapped on the sphere as an input to a optical flow or similar, you have to determine the coordinate on the sphere that is at the intersection of a vector from the center, through the particle onto the sphere.
Thinking about it as a mapping onto a 2D texture, what you actually need to get is the polar angle of that point and the azimuth. Both values can be normalized to a 0-1 value range and then used as uv coordinates to lookup values in the visualization texture or it’s optical flow map.
Hope this helps a bit
Best
Markus
Ok, as a beginner, I can’t say I completely understand the process, but it definitely helps me a lot to get started and think technicalities. Thank you very much.
So you think that the optical flow in the Particles GPU could serve that purpose, or I should look into working in Tops?
And lastly, do you have in mind any tutorial that could help in these issues?
Thank you in advance, your replies have been a tremendous help!
Hi @Johncaraj,
when working with the particlesGPU component from the Palette, you can use its second output as this is each particles position in TOP form.
Now this brings you to solving that math question and converting the xyz positions into angles that later can be used as a uv lookup into your visualization texture.
When looking for an answer for this, you could search for: converting carthesian to spherical coordinates. This will give you formulas to calculate usually 3 elements:
- r → is the radial distance of the coordinate from the center and is calculated by sqrt(x^2+y^2+z^2)
- θ → is the polar angle and calculated with tan θ = y/x
- φ → is the azimuthal angle and calculated with cos φ = z / sqrt(x^2+y^2+z^2)
The value of θ is when thinking of your visualization being mapped on a sphere around you, the same as the position on the horizontal of that texture (u). We just have to map the range of θ to 0-1 and the range of φ - the vertical axis of the texture mapped onto the sphere - to 0-1 as well.
There are some very useful TOPs that hold most of the functions needed for this, especially thinking of the Math and Function TOP.
For Tutorials in connection to Math operations in TOPs, please have a look at what @paketa12 has to offer online.
cheers
Markus
Wow, thank you so much, this is super informative. Hmm ok I see now.
Ps. I am just amazed of how helpful this community is, from all the software I’ve been working with so far the TD community is the most helpful and kind, thanks again.
Cheers