3D House

It's a VR project. Although it's better to do it by other softwares, I attempt to make it by Mupad. It's a good opportunity to enhance my skills and explore as many interesting things as I can.

Contents

House

We can change the view or even walk into the house.

House with Trees

Besides, I add some trees and toys around the house. Very cute, isn't it?

Code

////////////////////wall//////////////////////////////////////

for j from 0 to 6 do

      WL1[j] := plot::Group3d(plot::Box(0..1, 2*j..2*j+1, n..n+1,Color = RGB::VioletRedPale) $ n=1..10):
      WL2[j] := plot::Group3d(plot::Box(0..1, 2*j+1..2*j+2, n-0.5..n+0.5,Color = RGB::VioletRedPale) $ n=1..10):
      WL3[j] := plot::Group3d(plot::Box(0..1, 2*j..2*j+1, n..n+1) $ n=15..20,Color = RGB::VioletRedPale):
      WL4[j] := plot::Group3d(plot::Box(0..1, 2*j+1..2*j+2, n-0.5..n+0.5,Color = RGB::Yellow) $ n=15..20):




end_for:


for j from 0 to 6 do

      WR1[j] := plot::Group3d(plot::Box(14..15, 2*j..2*j+1, n..n+1,Color = RGB::VioletRedPale) $ n=1..20):
      WR2[j] := plot::Group3d(plot::Box(14..15, 2*j+1..2*j+2, n-0.5..n+0.5,Color = RGB::OrangeRed) $ n=1..20):


end_for:
for j from 0 to 6 do

      W1[j] := plot::Group3d(plot::Box(2*j..2*j+1, 13..14, n..n+1,Color = RGB::VioletRedPale) $ n=1..20):
      W2[j] := plot::Group3d(plot::Box(2*j+1..2*j+2, 13..14, n-0.5..n+0.5) $ n=1..20):


end_for:

for j from 0 to 6 do

      WF1[j] := plot::Group3d(plot::Box(1+3*j..3*j+4, 0..1, 2*n..2*n+4,Color = RGB::VioletRedPale) $ n=4..8):



end_for:


      D1 := plot::Group3d(plot::Box(1..9.5, 0..1, 0.5+4*n..4*n+4,Color= RGB::PaleBlue) $ n=0..1):
/////////Roof//////////
for j from 0 to 2 do

      R1[j] := plot::Group3d(plot::Box(1+j..j+3, 2*n..2*n+2, 20+3*j..3*j+23, Color = RGB::Green) $ n=0..6):
      R2[j] := plot::Group3d(plot::Box(4+j..j+12, 2*n..2*n+2, 29..30) $ n=0..6):
      R3[j] := plot::Group3d(plot::Box(6+j..j+12, 0..2, 20+n..n+24,Color = RGB::Yellow) $ n=0..5):
      R4[j] := plot::Group3d(plot::Box(6+j..j+12, 12..14, 20+n..n+24,Color = RGB::Yellow) $ n=0..5):



end_for:




      T1 := plot::Group3d(plot::Box(15..23, 1..2, 5*n..5*n+5, Color = RGB::Grey) $ n=0..6):
      T2 := plot::Group3d(plot::Box(15..23, 13..14, 5*n..5*n+5,Color = RGB::VioletRedPale) $ n=0..6):
      T3 := plot::Group3d(plot::Box(22..23, 1..14, 5*n..5*n+5, Color = RGB::Grey) $ n=0..6):
      T4 := plot::Group3d(plot::Box(14..15, 1..14, 5*n..5*n+5) $ n=0..6):
      T5 := plot::Prism(5, [19, 1,38], [19, 14, 38], Color = RGB::Green):

/////////////tree////////////////////

      G11 := plot::Cone(6, [-8,-8, 6], [-8, -8, 12],Color = RGB::Green):
      G12 := plot::Cone(3, [-8, -8, 11], [-8, -8, 15],Color = RGB::Green):
      G13 := plot::Cone(1.5, [-8, -8, 14], [-8, -8, 17],Color = RGB::Green):
      G14 := plot::Cone(1, [-8, -8, 0], 1,[-8, -8, 6],Color = RGB::DarkRed):

      G21 := plot::Cone(6, [-13,-4, 6], [-13, -4, 12],Color = RGB::Green):
      G22 := plot::Cone(3, [-13, -4, 11], [-13, -4, 15],Color = RGB::Green):
      G23 := plot::Cone(1.5, [-13, -4, 14], [-13, -4, 17],Color = RGB::Green):
      G24 := plot::Cone(1, [-13, -4, 0], 1,[-13, -4, 6],Color = RGB::DarkRed):

      G31 := plot::Cone(8, [-10,5,8], [-10,5, 16],Color = RGB::Green):
      G32 := plot::Cone(5, [-10, 5, 15], [-10,5, 19],Color = RGB::Green):
      G33 := plot::Cone(3, [-10, 5, 18], [-10,5, 23],Color = RGB::Green):
      G34 := plot::Cone(2, [-10, 5, 0], 2,[-10,5, 8],Color = RGB::DarkRed):

      G41 := plot::Cone(6, [30,30, 6], [30,30, 12],Color = RGB::Green):
      G42 := plot::Cone(3, [30,30, 11], [30,30, 15],Color = RGB::Green):
      G43 := plot::Cone(1.5, [30,30, 14], [30,30, 17],Color = RGB::Green):
      G44 := plot::Cone(1, [30,30, 0], 1,[30,30, 6],Color = RGB::DarkRed):

     toy1 := plot::Hexahedron  (Radius = 1.0, Center = [30, 0, 0]):
     toy2 := plot::Tetrahedron (Radius = 1.5, Center = [30, 4, 0]):
     toy3 := plot::Octahedron  (Radius = 2.0, Center = [30, 8, 0]):


plot(W1[j] $ j=0..6,W2[j] $ j=0..6,
     WL1[j] $ j=0..6, WL2[j] $ j=0..6,WL3[j] $ j=0..6,WL4[j] $ j=0..6,
     WR1[j] $ j=0..6,WR2[j] $ j=0..6,
     WF1[j] $ j=0..6,D1,
     R1[j] $ j=0..2,R2[j] $ j=0..2,R3[j] $ j=0..2,R4[j] $ j=0..2,
     T1,T2,T3,T4,T5,
     G11,G12,G13,G14,     G21,G22,G23,G24,  G31,G32,G33,G34,   G41,G42,G43,G44, toy1 ,toy2,toy3,