• Remix
  • Share
  • New Entry

on 6 Nov 2023
  • 5
  • 14
  • 0
  • 0
  • 458
drawframe(15);
Write your drawframe function below
function drawframe(f)
numPoints = 100;
maxRadius = 10 * (f / 24);
theta = rand(1, numPoints) * 2 * pi;
phi = acos(2 * rand(1, numPoints) - 1);
X = maxRadius * sin(phi) .* cos(theta);
Y = maxRadius * sin(phi) .* sin(theta);
Z = maxRadius * cos(phi);
C = sqrt(X.^2 + Y.^2 + Z.^2); % Use radial distance for color intensity
scatter3(X, Y, Z, 36, C, 'filled'); % Increase marker size for better visibility
% Define a custom fiery colormap
fieryColors = [1, 0, 0; ... % Red
1, 0.5, 0; ... % Orange
1, 1, 0; ... % Yellow
1, 1, 1]; % White for the brightest part
colormap(fieryColors);
% Normalize color mapping to the range of the data
caxis([min(C), max(C)]);
% Set the axis limits and view
axis([-10 10 -10 10 -10 10]);
axis off; % Hide the axis for a cleaner look
view(45, 30);
% Add light and improve lighting for a more dramatic effect
camlight right;
lighting gouraud;
end
Animation
Remix Tree