- WebGL Hotshot
- Mitch Williams
- 184字
- 2021-07-16 11:43:28
Lights, camera, action!
"Lights, camera, action!" is an old Hollywood phrase to start filming, but it is just as applicable to interactive 3D graphics. So, let's add lights, cameras, and interactivity to our X3D scenes.

Engage thrusters
This scene retains the first two objects created previously and adds a point light that can be thought of as a light bulb—a light from a single point emanating in all directions. We turned off the headlight inside the <NavigationInfo>
tag, and at the same time, restricted movement in the scene by setting type
to NONE
, simply to introduce this as part of the demo. At the same time, the <Viewpoint>
tag or camera is introduced with its default position
value, orientation
(rotation) value, and fieldOfView
value that defaults to π/4, that is, 0.785 radians. The added code is as follows:
<Scene> <NavigationInfo headlight="FALSE" type='"NONE"'/> <PointLight location="0 3 2"/> <Viewpoint position="0 0 10" orientation="0 0 1 0" fieldOfView=".785"/> <Transform …>
The point light is 3 units up and 2 units in front, so it clearly shines on the top of the box and to the left-hand side of the cone but not on the left-hand side of the box or the bottom of the cylinder.
- Aftershot Pro:Non-destructive photo editing and management
- 觸摸屏實(shí)用技術(shù)與工程應(yīng)用
- 計(jì)算機(jī)組裝與系統(tǒng)配置
- 極簡(jiǎn)Spring Cloud實(shí)戰(zhàn)
- BeagleBone By Example
- AMD FPGA設(shè)計(jì)優(yōu)化寶典:面向Vivado/SystemVerilog
- 筆記本電腦維修不是事兒(第2版)
- Learning Game Physics with Bullet Physics and OpenGL
- R Deep Learning Essentials
- 電腦高級(jí)維修及故障排除實(shí)戰(zhàn)
- BeagleBone Robotic Projects
- STM32自學(xué)筆記
- Instant Website Touch Integration
- Zabbix 4 Network Monitoring
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)案例教程(Windows 7+Office 2010)