colour dependent on the value at a certain point
Afficher commentaires plus anciens
So I plan to represent some data in terms of a sphere. I want to draw a sphere using my x y and z coordinates which I think I know how to do but then I would like to colour code the surface of the sphere dependent on the values of my function which depend on x and y z so to have for example, red for high values blue for low etc. any ideas how I go about this?
Many thanks guys! :)
10 commentaires
Walter Roberson
le 18 Jan 2013
color code the vertices or the faces? If the vertices is color interpolation to be done along the edges or faces?
Bran
le 19 Jan 2013
Modifié(e) : Walter Roberson
le 19 Jan 2013
Walter Roberson
le 19 Jan 2013
Where do you want the colors to change, and should the change be abrupt or should they shade into each other?
Bran
le 20 Jan 2013
Walter Roberson
le 20 Jan 2013
FFT of what? FFT is usually by frequency (or angle), rather than spatial. Depending on what you are doing there might not be any particular coordinates associated with the FFT. Or there might be a whole bunch of FFT coefficients associated with each coordinate.
Broadly speaking, if you are not doing FFT of a spherical function (including the possibility of FFT of a series of voxels arranged as a sphere), then you would probably not expect a spherical output of the FFT.
Bran
le 20 Jan 2013
Walter Roberson
le 20 Jan 2013
The FFT output is usually the same shape as the input (though that can vary if you use non-default number of points, or if you are doing an FFT over irregular points)
The input coordinates: are they 2D or 3D? Arranged in a circle? Arranged in a sphere? Arranged in rectangle? Regularly spaced or Irregularly spaced?
Bran
le 20 Jan 2013
Walter Roberson
le 20 Jan 2013
Ah, then spherical output representation becomes reasonable -- though surface of the sphere vs sphere as a volume becomes a consideration.
I take it you wrote your own spherical FFT routine? For any particular cubiod array input indices (I,J,K), what location is mapped to in your array that you put through your FFT routine? I presume here that the FFT routine puts its results into exactly the same logical shape as what was passed to it? If so then you should then be able to reverse the process to map the outputs back to cubiod array indices. Not using sphere(), just based on the exact reverse of the mapping that was used in the input processing. Once the FFT values are mapped back to cubiod array locations, we can proceed to do a voxel viewing or spherical surface generation.
Bran
le 20 Jan 2013
Réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!