SlideShare a Scribd company logo
1 of 4
Download to read offline
Please give me a custom example code of a complex PovRay Program that creates complex
images
Solution
// This is a realistic 3-D graphic image
// The following are some simple include files for predefined items
#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
// A. First Essential Feature: The CAMERA to take the picture
camera {
location <3, 12, -17> // Camera location: x,y,x coordinates in three-space
look_at <0, 5, -2> // Direction of view in three-space
}
// B. Second Essential Feature: The LIGHT SOURCE
light_source {
<-50,50,-30> // Location is behind the viewer, high, and to the left
color rgb <1.5, 1.5, 1.5> // This is a BRIGHT white light
}
// C. Third Essential Feature - The OBJECTS in three-space
// Object #1 - A checkerboard floor or plane
plane {
y, 0 // along the x-z plane (y is the normal vector)
pigment { checker color Black color White } // checkered pattern
finish {
ambient 0.2 // How much light is scattered from nearby objects
diffuse 0.8 // How much light comes from the direct source
}
scale 2 // Enlarge the basic checker pattern by a factor of two
}
// Object #2 - A shiny red sphere
sphere {
<1.0, 6.0, 3.7>, 5 // The of the sphere and it's radius
pigment {
color rgbf <1, 0, 0, 0> // Red, Green, Blue and Filter (transparency)
}
finish {
phong 0.8 // The shiny highlight
reflection 0.8 // How much light bounces off the object
}
}
// Objetct #3 - A moderatley shiny yellow box
box {
<-1, 0, -3> <-5, 8, -7> // Two corners of the box
texture{
pigment {
marble
color_map {
[0.0 color rgbf <1, 1, 0.2, 0.0>]
[1.0 color rgbf <1, 1, 0.8, 0.0>]
}
turbulence 1.5 lambda 1.5 omega 0.75 octaves 8
}
normal {bumps 0.2 scale 0.2}
finish {
phong 0.8
reflection 0.2
ambient 0.15
diffuse 0.75
}
}
}
// Object #4 - A transparent blue torus (A torus is defined about the origin)
torus {2.5, 0.8 // Major radius (basic size) and minor radius (cross section)
pigment {color rgbf <0.2, 0.2, 1.0, 0.8>}// Strong blue and transparent
finish {
phong 1.0 // Highlight
reflection 0.5 // Shiny surface
refraction 1.2 // Properties of light passing through object
ior 1.8 // Index of refraction
}
translate <-1.2, 5.5, -6.8> // Move the torus away from the origin
}
// Object #5 - A cone with a portion removed
difference{
cone { < -9, 0, 2>, 4, // Center of base and radius
<-9, 11, 2>, 0 // Center of top and radius
}
sphere {<-9.1, 8, 1.4>, 1.2} // This sphere is removed from the cone
pigment {color rgbf <0.0, 0.6, 0.0, 0.0>} // Dark green
finish {
phong 1.0
reflection 0.2
}
}
//Object #6 - A blob
blob {
threshold 0.1 // Factor relating to how spheres merge
component 1.0, 1.8, < 5, 5, -4> // Sphere #1 strength, radius, and location
component 1.0, 1.0, <6.5, 5.5, -3> // Smaller sphere #2
component 1.0, 1.0, <6.5, 5.5, -5> // Smaller sphere #3
pigment {
image_map{ // Wrap an image around object instead of color
gif "azalea3.gif" // Targa file and name
map_type 0 // Typr of wrapping
interpolate 2 // Boundary type between colors
}
// turbulence 0.7 // Mess up pattern with turbulence
scale 3 // Enlarge covering image
rotate <8,-3,0>
}
finish {
phong 0.2 // Give modest high light
//reflection 0.1 // Minor reflective properties
}
}

More Related Content

More from jibinsh

The following expression was simplified incorrectly. In which line er.pdf
The following expression was simplified incorrectly. In which line er.pdfThe following expression was simplified incorrectly. In which line er.pdf
The following expression was simplified incorrectly. In which line er.pdfjibinsh
 
The energy used in the CaMn cycle for the production of carbohydrate .pdf
The energy used in the CaMn cycle for the production of carbohydrate .pdfThe energy used in the CaMn cycle for the production of carbohydrate .pdf
The energy used in the CaMn cycle for the production of carbohydrate .pdfjibinsh
 
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdf
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdfThe CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdf
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdfjibinsh
 
SensesFor each of the special senses, understand how a stimulus is.pdf
SensesFor each of the special senses, understand how a stimulus is.pdfSensesFor each of the special senses, understand how a stimulus is.pdf
SensesFor each of the special senses, understand how a stimulus is.pdfjibinsh
 
Recent Presidential debates have brought about a series of polls.pdf
Recent Presidential debates have brought about a series of polls.pdfRecent Presidential debates have brought about a series of polls.pdf
Recent Presidential debates have brought about a series of polls.pdfjibinsh
 
Quality function deployment (QFD) is a structures approach for integ.pdf
Quality function deployment (QFD) is a structures approach for integ.pdfQuality function deployment (QFD) is a structures approach for integ.pdf
Quality function deployment (QFD) is a structures approach for integ.pdfjibinsh
 
please send edited code. I have posted this a few times with lots of.pdf
please send edited code. I have posted this a few times with lots of.pdfplease send edited code. I have posted this a few times with lots of.pdf
please send edited code. I have posted this a few times with lots of.pdfjibinsh
 
Networking Question What are the key differences between forwarding.pdf
Networking Question What are the key differences between forwarding.pdfNetworking Question What are the key differences between forwarding.pdf
Networking Question What are the key differences between forwarding.pdfjibinsh
 
Most children with cystic fibrosis have frequent lung infections and.pdf
Most children with cystic fibrosis have frequent lung infections and.pdfMost children with cystic fibrosis have frequent lung infections and.pdf
Most children with cystic fibrosis have frequent lung infections and.pdfjibinsh
 
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdf
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdfA)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdf
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdfjibinsh
 
Lipid rafts are associated with which of the following activities re.pdf
Lipid rafts are associated with which of the following activities re.pdfLipid rafts are associated with which of the following activities re.pdf
Lipid rafts are associated with which of the following activities re.pdfjibinsh
 
JAVAWrite a program that takes a command-line argument representin.pdf
JAVAWrite a program that takes a command-line argument representin.pdfJAVAWrite a program that takes a command-line argument representin.pdf
JAVAWrite a program that takes a command-line argument representin.pdfjibinsh
 
In culture A, parents have children until they have a boy and a girl.pdf
In culture A, parents have children until they have a boy and a girl.pdfIn culture A, parents have children until they have a boy and a girl.pdf
In culture A, parents have children until they have a boy and a girl.pdfjibinsh
 
Im asking for hypothetical data based on health by raceethnicity .pdf
Im asking for hypothetical data based on health by raceethnicity .pdfIm asking for hypothetical data based on health by raceethnicity .pdf
Im asking for hypothetical data based on health by raceethnicity .pdfjibinsh
 
I have to write a polynomial class linked list program and i do not .pdf
I have to write a polynomial class linked list program and i do not .pdfI have to write a polynomial class linked list program and i do not .pdf
I have to write a polynomial class linked list program and i do not .pdfjibinsh
 
I need to adjust this Huffman code so that it asks for the user to i.pdf
I need to adjust this Huffman code so that it asks for the user to i.pdfI need to adjust this Huffman code so that it asks for the user to i.pdf
I need to adjust this Huffman code so that it asks for the user to i.pdfjibinsh
 
How many different diploid genotypes are possible for a gene that ex.pdf
How many different diploid genotypes are possible for a gene that ex.pdfHow many different diploid genotypes are possible for a gene that ex.pdf
How many different diploid genotypes are possible for a gene that ex.pdfjibinsh
 
I would like help with the question below. I have done a lot of rese.pdf
I would like help with the question below. I have done a lot of rese.pdfI would like help with the question below. I have done a lot of rese.pdf
I would like help with the question below. I have done a lot of rese.pdfjibinsh
 
How does H. pylori work in attacking the stomach lining What drugs .pdf
How does H. pylori work in attacking the stomach lining What drugs .pdfHow does H. pylori work in attacking the stomach lining What drugs .pdf
How does H. pylori work in attacking the stomach lining What drugs .pdfjibinsh
 
How can a surveyor damage someones bona fide rightsHow can a .pdf
How can a surveyor damage someones bona fide rightsHow can a .pdfHow can a surveyor damage someones bona fide rightsHow can a .pdf
How can a surveyor damage someones bona fide rightsHow can a .pdfjibinsh
 

More from jibinsh (20)

The following expression was simplified incorrectly. In which line er.pdf
The following expression was simplified incorrectly. In which line er.pdfThe following expression was simplified incorrectly. In which line er.pdf
The following expression was simplified incorrectly. In which line er.pdf
 
The energy used in the CaMn cycle for the production of carbohydrate .pdf
The energy used in the CaMn cycle for the production of carbohydrate .pdfThe energy used in the CaMn cycle for the production of carbohydrate .pdf
The energy used in the CaMn cycle for the production of carbohydrate .pdf
 
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdf
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdfThe CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdf
The CAN-SPAM Acta.   applies to virtually all promotional e-mails,.pdf
 
SensesFor each of the special senses, understand how a stimulus is.pdf
SensesFor each of the special senses, understand how a stimulus is.pdfSensesFor each of the special senses, understand how a stimulus is.pdf
SensesFor each of the special senses, understand how a stimulus is.pdf
 
Recent Presidential debates have brought about a series of polls.pdf
Recent Presidential debates have brought about a series of polls.pdfRecent Presidential debates have brought about a series of polls.pdf
Recent Presidential debates have brought about a series of polls.pdf
 
Quality function deployment (QFD) is a structures approach for integ.pdf
Quality function deployment (QFD) is a structures approach for integ.pdfQuality function deployment (QFD) is a structures approach for integ.pdf
Quality function deployment (QFD) is a structures approach for integ.pdf
 
please send edited code. I have posted this a few times with lots of.pdf
please send edited code. I have posted this a few times with lots of.pdfplease send edited code. I have posted this a few times with lots of.pdf
please send edited code. I have posted this a few times with lots of.pdf
 
Networking Question What are the key differences between forwarding.pdf
Networking Question What are the key differences between forwarding.pdfNetworking Question What are the key differences between forwarding.pdf
Networking Question What are the key differences between forwarding.pdf
 
Most children with cystic fibrosis have frequent lung infections and.pdf
Most children with cystic fibrosis have frequent lung infections and.pdfMost children with cystic fibrosis have frequent lung infections and.pdf
Most children with cystic fibrosis have frequent lung infections and.pdf
 
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdf
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdfA)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdf
A)abductionB)deductive reasoningc) inductive reasoningd)a wild.pdf
 
Lipid rafts are associated with which of the following activities re.pdf
Lipid rafts are associated with which of the following activities re.pdfLipid rafts are associated with which of the following activities re.pdf
Lipid rafts are associated with which of the following activities re.pdf
 
JAVAWrite a program that takes a command-line argument representin.pdf
JAVAWrite a program that takes a command-line argument representin.pdfJAVAWrite a program that takes a command-line argument representin.pdf
JAVAWrite a program that takes a command-line argument representin.pdf
 
In culture A, parents have children until they have a boy and a girl.pdf
In culture A, parents have children until they have a boy and a girl.pdfIn culture A, parents have children until they have a boy and a girl.pdf
In culture A, parents have children until they have a boy and a girl.pdf
 
Im asking for hypothetical data based on health by raceethnicity .pdf
Im asking for hypothetical data based on health by raceethnicity .pdfIm asking for hypothetical data based on health by raceethnicity .pdf
Im asking for hypothetical data based on health by raceethnicity .pdf
 
I have to write a polynomial class linked list program and i do not .pdf
I have to write a polynomial class linked list program and i do not .pdfI have to write a polynomial class linked list program and i do not .pdf
I have to write a polynomial class linked list program and i do not .pdf
 
I need to adjust this Huffman code so that it asks for the user to i.pdf
I need to adjust this Huffman code so that it asks for the user to i.pdfI need to adjust this Huffman code so that it asks for the user to i.pdf
I need to adjust this Huffman code so that it asks for the user to i.pdf
 
How many different diploid genotypes are possible for a gene that ex.pdf
How many different diploid genotypes are possible for a gene that ex.pdfHow many different diploid genotypes are possible for a gene that ex.pdf
How many different diploid genotypes are possible for a gene that ex.pdf
 
I would like help with the question below. I have done a lot of rese.pdf
I would like help with the question below. I have done a lot of rese.pdfI would like help with the question below. I have done a lot of rese.pdf
I would like help with the question below. I have done a lot of rese.pdf
 
How does H. pylori work in attacking the stomach lining What drugs .pdf
How does H. pylori work in attacking the stomach lining What drugs .pdfHow does H. pylori work in attacking the stomach lining What drugs .pdf
How does H. pylori work in attacking the stomach lining What drugs .pdf
 
How can a surveyor damage someones bona fide rightsHow can a .pdf
How can a surveyor damage someones bona fide rightsHow can a .pdfHow can a surveyor damage someones bona fide rightsHow can a .pdf
How can a surveyor damage someones bona fide rightsHow can a .pdf
 

Recently uploaded

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 

Please give me a custom example code of a complex PovRay Program tha.pdf

  • 1. Please give me a custom example code of a complex PovRay Program that creates complex images Solution // This is a realistic 3-D graphic image // The following are some simple include files for predefined items #include "colors.inc" #include "shapes.inc" #include "textures.inc" // A. First Essential Feature: The CAMERA to take the picture camera { location <3, 12, -17> // Camera location: x,y,x coordinates in three-space look_at <0, 5, -2> // Direction of view in three-space } // B. Second Essential Feature: The LIGHT SOURCE light_source { <-50,50,-30> // Location is behind the viewer, high, and to the left color rgb <1.5, 1.5, 1.5> // This is a BRIGHT white light } // C. Third Essential Feature - The OBJECTS in three-space // Object #1 - A checkerboard floor or plane plane { y, 0 // along the x-z plane (y is the normal vector) pigment { checker color Black color White } // checkered pattern finish { ambient 0.2 // How much light is scattered from nearby objects diffuse 0.8 // How much light comes from the direct source } scale 2 // Enlarge the basic checker pattern by a factor of two } // Object #2 - A shiny red sphere
  • 2. sphere { <1.0, 6.0, 3.7>, 5 // The of the sphere and it's radius pigment { color rgbf <1, 0, 0, 0> // Red, Green, Blue and Filter (transparency) } finish { phong 0.8 // The shiny highlight reflection 0.8 // How much light bounces off the object } } // Objetct #3 - A moderatley shiny yellow box box { <-1, 0, -3> <-5, 8, -7> // Two corners of the box texture{ pigment { marble color_map { [0.0 color rgbf <1, 1, 0.2, 0.0>] [1.0 color rgbf <1, 1, 0.8, 0.0>] } turbulence 1.5 lambda 1.5 omega 0.75 octaves 8 } normal {bumps 0.2 scale 0.2} finish { phong 0.8 reflection 0.2 ambient 0.15 diffuse 0.75 } } } // Object #4 - A transparent blue torus (A torus is defined about the origin) torus {2.5, 0.8 // Major radius (basic size) and minor radius (cross section) pigment {color rgbf <0.2, 0.2, 1.0, 0.8>}// Strong blue and transparent finish { phong 1.0 // Highlight
  • 3. reflection 0.5 // Shiny surface refraction 1.2 // Properties of light passing through object ior 1.8 // Index of refraction } translate <-1.2, 5.5, -6.8> // Move the torus away from the origin } // Object #5 - A cone with a portion removed difference{ cone { < -9, 0, 2>, 4, // Center of base and radius <-9, 11, 2>, 0 // Center of top and radius } sphere {<-9.1, 8, 1.4>, 1.2} // This sphere is removed from the cone pigment {color rgbf <0.0, 0.6, 0.0, 0.0>} // Dark green finish { phong 1.0 reflection 0.2 } } //Object #6 - A blob blob { threshold 0.1 // Factor relating to how spheres merge component 1.0, 1.8, < 5, 5, -4> // Sphere #1 strength, radius, and location component 1.0, 1.0, <6.5, 5.5, -3> // Smaller sphere #2 component 1.0, 1.0, <6.5, 5.5, -5> // Smaller sphere #3 pigment { image_map{ // Wrap an image around object instead of color gif "azalea3.gif" // Targa file and name map_type 0 // Typr of wrapping interpolate 2 // Boundary type between colors } // turbulence 0.7 // Mess up pattern with turbulence scale 3 // Enlarge covering image rotate <8,-3,0> } finish {
  • 4. phong 0.2 // Give modest high light //reflection 0.1 // Minor reflective properties } }