Skip to main content

2021 | Buch

Multi-Platform Graphics Programming with Kivy

Basic Analytical Programming for 2D, 3D, and Stereoscopic Design

insite
SUCHEN

Über dieses Buch

Modern science requires computer graphics models to provide realistic visual renderings. Learning the appropriate programming tools for 2D and 3D modeling doesn’t have to be so difficult. This book reviews the best programming tools to achieve this and explains how to apply them to mobile platforms like Android.

Multi-Platform Graphics Programming with Kivy provides a straightforward introductory approach for designing 2D, 3D, and stereoscopic applications, using analytical equations from vector algebra. Throughout the book you’ll look closely at this approach and develop scenes in Kivy, taking advantage of powerful mathematical functions for arrays by NumPy for Python.

Unbuntu is used to develop the programs, which allows you to easily convert to Android platform. Each chapter contains step-by-step descriptions on each subject and provides complete program listings.

What You’ll LearnWork with Kivy, a modern, powerful multi-platform graphics systemConvert and run programs on Android devicesProgram, fill faces, and rotate 2D and 3D polygonsApply the concepts of 2D and 3D applicationsDevelop stereoscopic scenesReview a straightforward introduction to 2D, 3D, and stereoscopic graphics applicationsUse simple analytical equations from vector algebraWho This Book Is For

The primary audience is students and researchers in graphics programming with experience in analytical equations.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Getting Started: Software installation
Abstract
The code presented in this book can be executed on any platform running Python. However, to translate the programs into applications that can be installed and executed on Android, the developing operating system must be Ubuntu. We briefly describe the preliminary steps to run Python along with the required applications in Ubuntu. In this case, we are using Ubuntu 20.04.1 LTS.
Moisés Cywiak, David Cywiak
Chapter 2. Two-Dimensional Mapping and Rotation Equations of a Point
Abstract
In this chapter, we cover basic equations for rotating two-dimensional points and mapping them on the computer’s screen.
Moisés Cywiak, David Cywiak
Chapter 3. Two-Dimensional Polygon Programming
Abstract
In this chapter, we introduce programming elements for placing and rotating polygons on the screen. The concepts presented are based on the analytical equations derived in Chapter 2.
Moisés Cywiak, David Cywiak
Chapter 4. Three-Dimensional Projections and Rotations
Abstract
In this chapter, we present two basic concepts required for constructing and rotating three-dimensional polygons. The first concept refers to the analytical equations to project points from a three-dimensional space onto a two-dimensional screen. The second concept refers to the equations to calculate the rotation of points in a three-dimensional space.
Moisés Cywiak, David Cywiak
Chapter 5. Programming Three-Dimensional Polygons
Abstract
In this chapter, we describe how to construct and rotate polygons by using the equations obtained in Chapter 4.
Moisés Cywiak, David Cywiak
Chapter 6. Stereoscopic 3D Programming
Abstract
In this chapter, we describe the basic programming tools needed to provide stereoscopic 3D views of the polygons.
Moisés Cywiak, David Cywiak
Chapter 7. 3D Plots Programming
Abstract
In this chapter, we describe basic elements to create and plot functions of the form f(x, y).
Moisés Cywiak, David Cywiak
Chapter 8. Stereoscopic 3D Plots
Abstract
In this chapter, we describe the basic elements for constructing stereoscopic 3D plots of analytical functions. A screenshot of this program obtained from an Android cell phone is shown in Figure 8-1.
Moisés Cywiak, David Cywiak
Chapter 9. Parametric 3D Plotting
Abstract
In this chapter, we present basic elements for parametric 3D plotting. A typical example on this subject consists of a three-dimensional circular helix, shown in Figure 9-1, which was obtained from a screenshot of this program running on an Android cell phone.
Moisés Cywiak, David Cywiak
Chapter 10. Stereoscopic parametric 3D Plots
Abstract
In this chapter, we present basic elements for constructing parametric 3D plots. A screenshot of a circular helix generated with this program running on an Android cell phone is shown in Figure 10-1.
Moisés Cywiak, David Cywiak
Chapter 11. SymPy
Abstract
In the previous chapters, we used NumPy to program our arrays, along with mathematical capabilities. In this chapter, we introduce SymPy. This Python library provides special mathematical functions and polynomials as well as powerful symbolic mathematics. You can include SymPy in your programs by means of the following directive:

              import sympy as sp.
            
Moisés Cywiak, David Cywiak
Chapter 12. Plotting Functions in Spherical Coordinates
Abstract
In this chapter, we describe fundamental elements for calculating and plotting functions in spherical coordinates. For the working examples, we focus on the so-called spherical harmonics polynomials, encountered on diverse physical problems, as is the case with electron orbitals derived from Schrödinger’s differential equation. These polynomials, represented as Yl, m, are characterized by two positive integers, l and m, with |m| ≤ l. The polynomials are functions of the zenithal and azimuthal coordinates, as described in the following sections.
Moisés Cywiak, David Cywiak
Chapter 13. Stereoscopic Plots in Spherical Coordinates
Abstract
In this chapter, we describe elements for creating stereoscopic scenes of functions expressed in spherical coordinates. As in Chapter 12, we focus on spherical harmonics.
Moisés Cywiak, David Cywiak
Chapter 14. Stereoscopic Simple Numerical Method for Gravitational N-body
Abstract
In this chapter, we provide a simple numerical approach to the gravitational N-body problem to be observed in a stereoscopic view. A screenshot of the program running on an Android cell phone is shown in Figure 14-1.
Moisés Cywiak, David Cywiak
Chapter 15. Stereoscopic Cylindrical Coordinates Plotting
Abstract
In this chapter, we describe elements for plotting stereoscopic 3D cylindrical functions. For this purpose, we focus on the so-called aberrations of optical lenses, also referred to as Seidel aberrations.
Moisés Cywiak, David Cywiak
Chapter 16. Stereoscopic Plotting of Three-Dimensional Conics
Abstract
In this chapter, we describe basic principles for plotting stereoscopic three-dimensional conics. Figure 16-1 shows two screenshots of this program running on an Android cell phone showing plots of a hyperboloid at two different angles of rotation.
Moisés Cywiak, David Cywiak
Chapter 17. Two-Dimensional Fourier Transform
Abstract
In this chapter, we present elements for calculating and plotting discrete two-dimensional Fourier transforms. Figure 17-1 provides two screenshots from an Android cell phone. The one on the left shows a rectangular, two-dimensional spatial-function. The right screenshot shows the corresponding discrete Fourier transform obtained using this program.
Moisés Cywiak, David Cywiak
Chapter 18. Stereoscopic Two-Dimensional Fourier Transform
Abstract
In this chapter, we present elements for calculating and plotting stereoscopic two-dimensional Fourier transforms. Figure 18-1 provides two screenshots from an Android cell phone. On the left is a two-dimensional spatial function, and on the right is a corresponding Fourier transform obtained with the program.
Moisés Cywiak, David Cywiak
Backmatter
Metadaten
Titel
Multi-Platform Graphics Programming with Kivy
verfasst von
Moisés Cywiak
David Cywiak
Copyright-Jahr
2021
Verlag
Apress
Electronic ISBN
978-1-4842-7113-1
Print ISBN
978-1-4842-7112-4
DOI
https://doi.org/10.1007/978-1-4842-7113-1

Neuer Inhalt