File:Spiral galaxy 6 r 1.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(1,600 × 1,200 pixels, file size: 658 KB, MIME type: image/png)

Captions

Captions

Spiral galaxy rendering

Summary

[edit]
Description
English: Spiral galaxy rendering with POV-Ray
Date
Source Own work
Author Merikanto

POV-Ray 3.7 source code

///////////////////////////////////////// // // spiral galaxy // // POV-Ray 3.7 source code // // 3.7.2023 0000.0003 //

  1. include "functions.inc"

camera { location <0,0,-2>*1.5 look_at <0,0,0>

angle 35

}

  1. declare expf1=function {

max(1-min ( -1* exp( -sqrt(x*x+y*y+0*0)),0 ),1) }

  1. declare hole1= function {
max( min( 1*f_sphere(x*5.5,y*5.5,0,2),1),0)

}


  1. declare powhole1=function {

pow( max(min(f_sphere(x*10,y*10,(0),1),1),0) ,6)

}

  1. declare f_normal1=function {


exp (-0.5*pow(((( sqrt(x*x+y*y) ))/0.5),2))

}


  // logarithmic spiral 0
  1. declare logspiral0=function {
    (1*log(sqrt(x*x+y*y))*pi*2)+10*(atan2(x,y)/(pi/2))

// ( sin ( (1*log(sqrt(x*x+y*y))*pi*2)+1*(atan2(x,y)/(pi/2)) *pi/2 ) ) }

  // logarithmic spiral 1
  1. declare logspiral1=function {
  ((sin(logspiral0(x,y,z)*2*pi)/2)+0.5)   

}


  // logarithmic spiral 2
  1. declare logspiral2=function {
max(   min( (  ((sin((4*log(sqrt( (x*x+y*y) ))*pi*2)+((atan2(x,y))/(pi*1))*2*pi)/2)+0.5) ) ,1),0)  

}

  // logarithmic spiral 1
  1. declare logspiral3=function {
//  ((sin(logspiral0(x,y,z)*1*pi/2)/2)+0.5)   

min ( max (

((( sin ( (2*log(sqrt( (x*x+y*y) ))*pi*2)+0.5*((atan2(x,y)/(1))/(pi/8)) *pi/2 ) ) +1)/2)

,0) ,1)

}

   // logarithmic spiral 1
  1. declare logspiral4=function {
//  ((sin(logspiral0(x,y,z)*1*pi/2)/2)+0.5)   

min ( max (

((( sin ( (2*log(sqrt( (x*x+y*y) ))*pi*2)+0.5*((atan2(x,y))/(pi/16)) *pi/2 ) ) +1)/2)

,0) ,1)

}

   // logarithmic spiral 1
  1. declare logspiral5=function {
//  ((sin(logspiral0(x,y,z)*1*pi/2)/2)+0.5)   

min ( max (

((( sin ( (2*log(sqrt( (x*x+y*y) ))*pi*2)+0.5*((atan2(x,y))/(pi/16)) *pi/2 ) ) +1)/2)

,0) ,1)

}

  1. declare spirals1= function

{

max ( min( (logspiral1(x,y,z) *f_normal1(x,y,z)) ,1) ,0)

}


#declare spirals2= function

{

max ( min( (logspiral1(x,y,z) *f_normal1(x,y,z)) ,1) ,0)

}


  1. declare spiralnormal1 = function {
 (f_normal1(x*1.5,y*1.5,z*1.5)*logspiral2(x,y,z)/2 )

}

#declare spiralnormalhole1 = function {
 (f_normal1(x*1.5,y*1.5,z*1.5)*logspiral2(x,y,z)/2 ) *hole1(x*3,y*3,z*3)

}

#declare spiralnormalhole2 = function {
 (f_normal1(y*1.5,x*1.5,z*1.5)*logspiral2(x,y,z)/2 ) *hole1(x*3,y*3,z*3)

}


  1. declare galax_trunc1= function {
spiralnormalhole1(x,y,z)/3
+pow(f_normal1(x*1.5,y*1.5,z*1.5)/2,2)/3
+max ( f_normal1(x*5,y*5,z*5)/3, spiralnormalhole1(x,y,z)/3 )

}

#declare galax_trunc2= function {
spiralnormalhole2(x,y,z)/3
+pow(f_normal1(x*1.5,y*1.5,z*1.5)/2,2)/3
+max ( f_normal1(x*5,y*5,z*5)/3, spiralnormalhole1(x,y,z)/3 )

}

 #declare galbi1=function {

( galax_trunc2(x,y,z)* f_granite ( galax_trunc2(x,y,z),1-f_granite(x*3,y*3,z*3),f_wrinkles(x*30,y*30,z*30))/2

+ galax_trunc1(x,y,z)* f_granite (  galax_trunc1(x,y,z),1-f_granite(x*3,y*3,z*3),f_wrinkles(x*30,y*30,z*30))/2  )                       
* ( 

(

f_wrinkles(x*30,y*30,z*30) *8
*f_wrinkles(x*100,y*100, z*100)*4   
*f_wrinkles(x*300,y*300, z*300)*2   
*f_wrinkles(x*1000,y*1000, z*1000)*1 )) /4

}


  1. declare norma1= function {
f_normal1(x,y,z)*0.01


+ f_normal1(x*3,y*3,z*3)*0.12

}


 #declare spiku1= function {
//  galax1(x,y,z)
(

// galax_trunc2(x,y,z)* f_granite ( galax_trunc2(x,y,z),1-f_granite(x*3,y*3,z*3),f_wrinkles(x*30,y*30,z*30))/2

(

galax_trunc1(x,y,z)* f_granite (  galax_trunc1(x,y,z),1-f_granite(x*3,y*3,z*3),f_wrinkles(x*30,y*30,z*30))/2  )                       
*(f_wrinkles(galax_trunc1(x,y,z),y*10,z*10)/2+f_wrinkles(x*100*galax_trunc1(x,y,z),y*100,z*100)/2)*1
*f_granite(x*10*galax_trunc1(x,y,z),y*10*f_granite(x,y,z), z*10*f_wrinkles(x*10,y*10,z*10)) 
 *f_wrinkles(x*100,y*100, z*100)*4   
*f_wrinkles(x*300,y*300, z*300)*2  
)*pow(f_granite(x,y,z),1)

}


  1. declare galbitex1= texture {
  pigment {
   
       function { galbi1(x,y,z) }
 //         turbulence 0.01
        
poly_wave 1
      color_map {
       [0 rgbt <1,1,1,1>]
       [1 rgbt <1/8,1/8,1,0>*1]
       }
   }
finish {ambient 1}
// normal {   function { pigu1(x,y,z) }}

}

  1. declare spitex1= texture {
  pigment {
   
       function { spiku1(x,y,z)*f_wrinkles(x*30,y*30,x*30) }
          

//poly_wave 1.4

// turbulence 0.05

      color_map {
       [0 rgbt <1,1,1,1>]
       [1 rgbt <10,1,1,0>*1]
       }
   }
finish {ambient 2}

}

  1. declare nortex1= texture {
  pigment {
   
       function {  norma1(x,y,z) }
          poly_wave 1
      color_map {
       [0 rgbt <1,1,1,1>]
       [1 rgbt <1,0,0,0>*1]
       }
   }
finish {ambient 8}

}

  1. declare gal1=object {

plane {z,0}

texture {galbitex1 scale 1/2} texture {galbitex1 scale 1/2 rotate z*60 } texture {spitex1 scale 1/2 rotate z*90}

 texture {nortex1 scale 1/2 rotate z*90}  

}


union {

   object {gal1   

rotate <30,40,50> }


}

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:10, 3 July 2023Thumbnail for version as of 11:10, 3 July 20231,600 × 1,200 (658 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata