Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 3d kaleidoscope!

View previous topic View next topic Go down 
AuthorMessage
bignono

avatar

Number of posts : 11
Age : 60
Localisation : Champigny-sur-Marne, 94500, France
Registration date : 2013-03-12

PostSubject: 3d kaleidoscope!   Fri Jul 19, 2013 8:56 pm

Hello everyone,

What I propose to you and who, I made, and quickly made!!!
I do not know if that resembles a kaleidoscope, but I obtain a superb effect, if you follow these adjustments:
1 - click on option "tore"
2- regulate the zomms X and Y there to approximately 20% of the scroll_bar and zoom Z at 100%
3- charge an unspecified texture with the button "TEXTURE"
4- actuate the scroll_bar "Z rotation" all in top on the right and click on the small button "on"
This stage, you must have a splendid figure which even turns on it.
To obtain other splendid effects, actuate the cursors scroll_bar "Opacity and Distance"
Then, nothing prevented you from changing the position of all the cursors to obtain splendid figures!
However, do not charge with Texture if you want to see the result with the cursors Colors and Lights.

You can use import which image, even a photograph.
bye
Code:
dim i,img$
label sphere,cube,dodeca,tore,zoom,couleur,transparence,distance,fond,lumiere,texture,fin
label X_rotation,Y_rotation,Z_rotation,on_off_X_rotation,on_off_Y_rotation,on_off_Z_rotation
full_space 0:scene3d 1:width 1,screen_x-150:height 1,screen_y-78:color 1,0,0,0
option 3:left 3,width(0)-145:top 3,025:caption 3," Cube "       :on_click 3,cube
option 4:left 4,width(0)-145:top 4,045:caption 4," Dodécahèdre ":on_click 4,dodeca
option 5:left 5,width(0)-145:top 5,065:caption 5," Tore "       :on_click 5,tore
option 6:left 6,width(0)-145:top 6,085:caption 6," Sphère "     :on_click 6,sphere
' zooms
scroll_bar 08:vertical 08:left 08,width(0)-145:top 08,140:min 08,1:max 08,100:on_change 08,zoom
scroll_bar 09:vertical 09:left 09,width(0)-125:top 09,140:min 09,1:max 09,100:on_change 09,zoom
scroll_bar 10:vertical 10:left 10,width(0)-105:top 10,140:min 10,1:max 10,100:on_change 10,zoom

alpha 11:left 11,width(0)-140:top 11,125:font_bold 11:caption 11,"ZOOMS     Rotations"
alpha 12:left 12,width(0)-140:top 12,265:font_bold 12:caption 12,"X   Y   Z    X   Y   Z"
' rotations
scroll_bar 13:vertical 13:left 13,width(0)-80:top 13,140:min 13,0:max 13,30:on_change 13,X_rotation
scroll_bar 14:vertical 14:left 14,width(0)-60:top 14,140:min 14,0:max 14,30:on_change 14,Y_rotation
scroll_bar 15:vertical 15:left 15,width(0)-40:top 15,140:min 15,0:max 15,30:on_change 15,Z_rotation
' couleurs objets
scroll_bar 16:vertical 16:left 16,width(0)-145:top 16,320:min 16,0:max 16,255:on_change 16,couleur
scroll_bar 17:vertical 17:left 17,width(0)-125:top 17,320:min 17,0:max 17,255:on_change 17,couleur
scroll_bar 18:vertical 18:left 18,width(0)-105:top 18,320:min 18,0:max 18,255:on_change 18,couleur
' transparence
scroll_bar 19:vertical 19:left 19,width(0)-060:top 19,320:min 19,0:max 19,255:on_change 19,transparence

alpha 20:left 20,width(0)-145:top 20,305:font_bold 20:caption 20,"Couleurs     Opacité"
alpha 21:left 21,width(0)-145:top 21,445:font_bold 21:caption 21,"R   V   B"
' écarts
scroll_bar 22:horizontal 22:left 22,width(0)-145:top 22,510:min 22,0:max 22,10:on_change 22,distance
alpha 23:left 23,left(22):top 23,490:font_bold 23:caption 23,"DISTANCE"
' couleur du fond
scroll_bar 24:vertical 24:left 24,width(0)-145:top 24,545:min 24,0:max 24,255:on_change 24,fond
scroll_bar 25:vertical 25:left 25,width(0)-125:top 25,545:min 25,0:max 25,255:on_change 25,fond
scroll_bar 26:vertical 26:left 26,width(0)-105:top 26,545:min 26,0:max 26,255:on_change 26,fond

alpha 27:left 27,width(0)-140:top 27,530:font_bold 27:caption 27,"  FOND      Lumières"
alpha 28:left 28,width(0)-140:top 28,670:font_bold 28:caption 28,"R   V   B    X   Y   Z"
' position de la lumière
scroll_bar 29:vertical 29:left 29,width(0)-80:top 29,545:min 29,-100:max 29,100:on_change 29,lumiere
scroll_bar 30:vertical 30:left 30,width(0)-60:top 30,545:min 30,-100:max 30,100:on_change 30,lumiere
scroll_bar 31:vertical 31:left 31,width(0)-40:top 31,545:min 31,-100:max 31,100:on_change 31,lumiere

button 32:left 32,width(0)-125:top 32,460:caption 32,"TEXTURE":on_click 32,texture

button 33:width 33,18:left 33,width(0)-80:top 33,277:caption 33,"on":on_click 33,on_off_X_rotation
button 34:width 34,18:left 34,width(0)-60:top 34,277:caption 34,"on":on_click 34,on_off_Y_rotation
button 35:width 35,18:left 35,width(0)-40:top 35,277:caption 35,"on":on_click 35,on_off_Z_rotation

timer 50:timer_off 50:timer_interval 50,20:on_timer 50,X_rotation
timer 51:timer_off 51:timer_interval 51,20:on_timer 51,Y_rotation
timer 52:timer_off 52:timer_interval 52,20:on_timer 52,Z_rotation

on_close 0,fin

init()
end

sub init()
position 8,1:position 9,1:position 10,1:position 13,0:position 14,0:position 15,0
position 16,0:position 17,0:position 18,0:position 19,0:position 22,5
position 24,0:position 25,0:position 26,0:position 29,0:position 30,0:position 31,0
gosub zoom
end_sub

zoom:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_scale i,position(8)/10,position(9)/10,position(10)/10
next i
return

on_off_X_rotation:
if caption$(33)="on"
   caption 33,"off":timer_on 50
else
   caption 33,"on":timer_off 50
end_if
return

on_off_Y_rotation:
if caption$(34)="on"
   caption 34,"off":timer_on 51
else
   caption 34,"on":timer_off 51
end_if
return

on_off_Z_rotation:
if caption$(35)="on"
   caption 35,"off":timer_on 52
else
   caption 35,"on":timer_off 52
end_if
return

X_rotation:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_x_rotate i,o3d_x_rotate(i)+position(13)/10
next i
return

Y_rotation:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_y_rotate i,o3d_y_rotate(i)+position(14)/10
next i
return

Z_rotation:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_z_rotate i,o3d_z_rotate(i)+position(15)/10
next i
return

couleur:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_color i,position(16),position(17),position(18)
next i
return

transparence:
for i=2 to 11
   if o3d_object_exists(i)=1 then 3d_transparent i,position(19)
next i
return

distance:
cam_z_position position(22):return

fond:
color 1,position(24),position(25),position(26):return

lumiere:
light_position position(29),position(30),position(31)
return

texture:
open_dialog 98
filter 98,"fichiers images: *.bmp,*.jpg|*.bmp;*.jpg"
img$=file_name$(98)
delete 98
if img$<>"_"
   for i=2 to 11
      if o3d_object_exists(i)=1 then 3d_load_texture i,img$
   next i
end_if
return

sphere:
3d_delete_all
3d_sphere 2,0.5
3d_sphere 3,0.5:3d_position 3,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)
3d_sphere 4,0.5:3d_position 4,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)
3d_sphere 5,0.5:3d_position 5,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)
3d_sphere 6,0.5:3d_position 6,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)
3d_sphere 07,0.5:3d_position 07,o3d_x_position(2),o3d_y_position(2),o3d_z_position(2)-5
3d_sphere 08,0.5:3d_position 08,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_sphere 09,0.5:3d_position 09,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)-5
3d_sphere 10,0.5:3d_position 10,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_sphere 11,0.5:3d_position 11,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)-5
init()
return

cube:
3d_delete_all
3d_cube 2,0.5
3d_cube 3,0.5:3d_position 3,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)
3d_cube 4,0.5:3d_position 4,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)
3d_cube 5,0.5:3d_position 5,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)
3d_cube 6,0.5:3d_position 6,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)
3d_cube 07,0.5:3d_position 07,o3d_x_position(2),o3d_y_position(2),o3d_z_position(2)-5
3d_cube 08,0.5:3d_position 08,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_cube 09,0.5:3d_position 09,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)-5
3d_cube 10,0.5:3d_position 10,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_cube 11,0.5:3d_position 11,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)-5
init()
return

dodeca:
3d_delete_all
3d_dodecahedron 2
3d_dodecahedron 3:3d_position 3,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)
3d_dodecahedron 4:3d_position 4,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)
3d_dodecahedron 5:3d_position 5,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)
3d_dodecahedron 6:3d_position 6,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)
3d_dodecahedron 07:3d_position 07,o3d_x_position(2),o3d_y_position(2),o3d_z_position(2)-5
3d_dodecahedron 08:3d_position 08,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_dodecahedron 09:3d_position 09,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)-5
3d_dodecahedron 10:3d_position 10,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_dodecahedron 11:3d_position 11,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)-5
init()
return

tore:
3d_delete_all
3d_torus 2,1,0.5
3d_torus 3,1,0.5:3d_position 3,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)
3d_torus 4,1,0.5:3d_position 4,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)
3d_torus 5,1,0.5:3d_position 5,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)
3d_torus 6,1,0.5:3d_position 6,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)
3d_torus 07,1,0.5:3d_position 07,o3d_x_position(2),o3d_y_position(2),o3d_z_position(2)-5
3d_torus 08,1,0.5:3d_position 08,o3d_x_position(2)+2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_torus 09,1,0.5:3d_position 09,o3d_x_position(2)+2,o3d_y_position(2)-2,o3d_z_position(2)-5
3d_torus 10,1,0.5:3d_position 10,o3d_x_position(2)-2,o3d_y_position(2)+2,o3d_z_position(2)-5
3d_torus 11,1,0.5:3d_position 11,o3d_x_position(2)-2,o3d_y_position(2)-2,o3d_z_position(2)-5
init()
return

fin:
timer_off_all
Back to top Go down
View user profile
treehouse

avatar

Number of posts : 10
Age : 56
Localisation : Yorkshire, UK
Registration date : 2013-10-16

PostSubject: Re: 3d kaleidoscope!   Thu Oct 17, 2013 1:44 pm

Nice one, bignono. Very pretty. It would be fun to add a camera rotation as well - then the whole set of objects would appear to turn.

I did get a "too many nested gotos/subs" error after a while, not sure why.
Back to top Go down
View user profile
 
3d kaleidoscope!
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: