Generating a 3D Plot Using a Hemisphere

I am using Blender for something a little unorthodox. I’m creating a 3D spherical plot that can be updated in real time based on the objects in my scene. The first thing that came to mind was to iterate through phi and theta using raycast and select the closest vertex, but this seems like a much, much better method:

  • Create a hemisphere based on the desired angular resolution (Ex: For 1 degree resolution, use UV Sphere with 360 segments and 180 rings)
  • Iterate through the vertices of the hemisphere’s mesh
  • Convert each vertices’ coordinates to spherical (r, theta, phi)
  • Use theta and phi as input to equation, modify r based on equation’s output and shift the vertex location to correspond to new r

Now this does seem a huge improvement over raycasting using my own phi and theta to select vertices, but it’s still iterative and I’m not sure how long it will end up taking to calculate after having to access the mesh, then vertex, then get the point, do the math, then move the vertex for each iteration.

Is there a way I could access all the vertices at once so I could use vector and matrix math instead of iteratively accessing one vertex at a time?

Any other suggestions or obstacles with this method that I may not have foreseen?

do you need to control each vertex ?

there is already a sort of spherical mapping to map an image to a sphere!

can that do the job?

happy 2.5

Yeah I wanted to actually change the r value of the spherical coordinates to be relative to the solution at each theta and phi so the plot is 3D, but thanks for the suggestion, I’ll have to keep that functionality in mind for later.

well sorry but can you give a better description here cause it’s a bit vague what you want to do with this

are you trying to work in a spherical coordinates system for something special ?

or is it only a matter of mapping a texture onto a 1/2 sphere!

thanks
happy 2.5

So starting with a normal round hemisphere, I iterate through each vertex, determine the theta and phi correlating to that vertex location, and plug that into an equation to determine r, lets say R = 4pisin(theta)*cos(phi) or whatever you want. Once the R is determined, you take the Phi and Theta that were calculated from the original vertex, and using the R you just calculated, you take those spherical coordinates (r, theta, phi) and convert them to Cartesian (x,y,z). The effect of this will move the vertex outward or inward directly from or towards the center of the hemisphere, turning the previously spherical hemisphere into a 3D plot based on the equation we chose for R.

You can use a list comprehension to make a list of verts (or theta,phi calculations) and then just work on that.

But the best way is to just write the code and then figure out where it’s slow.

then it’s probably easier to make your sphere yourself as a new object
then do your math then make your mesh

that ways you control R and angles as you wish !

are your going to show the code for this ?

i remember doing one like this for something a few months ago!
but ounce you work in spherical coord you just have to convert to Rect coordi
should be easy to do !

happy 2.5