Skip to Content
Raspberry Pi 3 Cookbook for Python Programmers - Third Edition
book

Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

by Steven Lawrence Fernandes, Tim Cox
April 2018
Beginner content levelBeginner
552 pages
13h 58m
English
Packt Publishing
Content preview from Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

How it works...

Like the 3dObject.py example, we define the DISPLAY shader (this time using uv_reflect) and some additional textures—bumptex (floor_nm.jpg) and shinetex (stars.jpg)—to use later. We define a model that we want to import, placing it at z=10 (if no coordinates are given, it will be placed at (0,0,0)). Since we do not specify a camera position, the default will place it within the view (see the section regarding the camera for more details).

We apply the shader using the set_shader() function. Next, we add some textures and effects using bumptex as a surface texture (scaled by 4). We apply an extra shiny effect using shinetex and apply a reflection strength of 0.5 (the strength ranges from 0.0, the weakest, to 1.0, the strongest) ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Raspberry Pi for Python Programmers Cookbook - Second Edition

Raspberry Pi for Python Programmers Cookbook - Second Edition

Tim Cox

Publisher Resources

ISBN: 9781788629874Supplemental Content