image thumbnail

Rose Model

by

 

two example that generate a 3D rose.

roseplot2.m
clear,clc

[x,t] = meshgrid((0:24)/24,((0:575)/575*17-2)*pi);
p     = (pi/2)*exp(-t/8/pi);
u     = 1-(1-mod(2.5*t/pi,2)).^4/2;
y     = 2*(x.*(x-1)).^2.*sin(p);
r     = u.*(x.*sin(p)+y.*cos(p));
z     = abs(u.*(x.*cos(p)-y.*sin(p)));
z     = 4*z.*r;
x     = r.*cos(t).*(abs(sin(2.3*sqrt(z)))+.3*z);
y     = r.*sin(t).*(abs(sin(2.3*sqrt(z)))+.3*z);
figure('Color','k') 
surface(x,y,z,'EdgeColor','none','FaceColor','r')
view(-36,18),axis equal off
light('pos',[-.25 -.25 1], 'style','infinite', 'color',[1 .84 .6])
lighting gouraud

Contact us