Python Graphics by Bernard Korites
Author:Bernard Korites
Language: eng
Format: epub
ISBN: 9781484296608
Publisher: Apress
(7-5)
where C1 and C2 are constants and n is a parameter. n can be changed in the program. Noting that I=IA at ,
(7-6)
(7-7)
At = +2, ( = +1), I=IB,
(7-8)
(7-9)
With
(7-10)
Equation 7-10 is your intensity function, . You thus have three parameters with which to adjust I: IA, which regulates the intensity of the lightest areas; IB, which adjusts the darkest areas; and n, which adjusts the transition from light to dark. Higher values of n will produce a more rapid transition. Figure 7-14 shows curves for n=1, 2, 3, and 4. When n=1, the curve becomes linear. There are no definite values for n, IA, and IB; they should be adjusted by trial and error to give visually appealing results.
Regarding colors, the background shown in Figure 7-13 is 'midnightblue'. A good source for color samples is #https://matplotlib.org/examples/color/named_colors.html.
Listing 7-2 creates a sphere by plotting longitudes and latitudes as you did in Listing 6-4. In Listing 6-4, these were spaced six degrees apart. To carry out the shading in Listing 7-2, you will space the longitudes and latitudes closer together, two degrees apart. This creates 180x180=32,400 surface patches between the longitudes and latitudes. Assume each patch is flat. The intensity of color of each patch will depend on the angle between a local unit vector normal to the patch and the light source unit vector at each point on the surface. This will then be used to control the relative r,g,b contributions to the color mix. As before, you establish this relation by taking the dot product . at each point is determined quite simply by obtaining a vector from the sphereâs center to the point in question on the sphereâs surface and then dividing by the sphereâs radius, rs. For example, suppose you are at a point p on the sphereâs surface with coordinates xp,yp,zp. A vector Vp from the sphereâs center at xc,yc,zc to p is
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
3D Graphics | 3D Printing |
Adobe | CAD |
Computer Modelling | Desktop Publishing |
Electronic Documents | Rendering & Ray Tracing |
User Experience & Usability |
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7786)
Autodesk Civil 3D 2024 from Start to Finish by Stephen Walz Tony Sabat(6552)
Mathematics for Game Programming and Computer Graphics by Penny de Byl(6435)
Taking Blender to the Next Level by Ruan Lotter(6212)
Express Your Creativity with Adobe Express by Rosie Sue(6033)
Hands-On Unity 2022 Game Development - Third Edition by Nicolas Alejandro Borromeo(5644)
Hands-On Unity 2022 Game Development by Nicolas Alejandro Borromeo(4761)
Adobe Illustrator for Creative Professionals by Clint Balsar(3679)
Unreal Engine 5 Character Creation, Animation, and Cinematics by Henk Venter & Wilhelm Ogterop(3627)
Going the Distance with Babylon.js by Josh Elster(3596)
Mastering Graphics Programming with Vulkan by Marco Castorina & Gabriel Sassone(3499)
Squeaky Clean Topology in Blender by Michael Steppig(3436)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2916)
Unreal Engine 5 Character Creation, Animation, and Cinematics by Henk Venter Wilhelm Ogterop(2874)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2701)
The 46 Rules of Genius: An Innovator's Guide to Creativity (Voices That Matter) by Marty Neumeier(2657)
Learn Qt 5: Build modern, responsive cross-platform desktop applications with Qt, C++, and QML by Nicholas Sherriff(2366)
Fusion 360 for Makers by Lydia Sloan Cline(2222)
Hands-On Neural Networks with Keras by Niloy Purkait(2168)
