当前位置:网站首页>Preliminary understanding of Panda3D fog
Preliminary understanding of Panda3D fog
2022-07-20 13:18:00 【bcbobo21cn】
function Panda Example Infinite-Tunnel, Infinite tunnel ; A moving , There is no end to the tunnel ;
Toggle Fog, The swappable Fog The color of the ;Fog Can show or not show ;Fog Color switchable ;
Take a look at the code for this example , The main function code has three parts ; Load model , Model animation , The effect of superimposing fog ; Fog ,Fog;
Part by part , Have a look first Fog How do you do it? ;
Fog,Panda Provide a class ; The manual is described below ;
from panda3d.core import Fog
classFog
Bases: PandaNode
Specifies how atmospheric fog effects are applied to geometry. The Fog object is now a PandaNode, which means it can be used similarly to a Light to define effects relative to a particular coordinate system within the scene graph.
The basic fog procedure is as follows ;
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from panda3d.core import Point3
from panda3d.core import Fog
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.fog = Fog('myFog1')
self.fog.setColor(0, 0.5, 0)
self.fog.setExpDensity(.08)
#self.fog.setLinearRange(0, 320)
#self.fog.setLinearFallback(45, 160, 320)
render.setFog(self.fog)
app = MyApp()
app.run()
Indent and adjust yourself ; If the indentation is not correct, it cannot be compiled ; Don't comment it out first 2 sentence , Make a basic fog ,Fog;
Define a Fog object , Set the color , Set transparency ;
The effect is as follows ;
Fog , It should be a vague effect , The concentration of each part varies ; Add the notes 2 sentence , The effect is still the same ;
According to its manual ,Panda Support 3 There are two modes of Fog, Exponential type 、 linear 、 Exponential square ;self.fog.setLinearRange(0, 320), This sentence is to set the linear range ; Set or no effect ;
Make an exponential Fog, The basic code is as follows ;
myfog=Fog("fog1")
myfog.setColor(0.8, 1, 0.5)
myfog.setExpDensity(0.05)
render.setFog(myfog)
It doesn't work ;setExpDensity, Set the exponential concentration of fog ;
The model of this example uses pview Look at the following ; I don't know how to make the tunnel effect ; Go on next time ;
边栏推荐
- 浏览器调试
- Nacos配置管理——配置热更新
- Paper reading: linknet: expanding encoder representations foreefficient semantic segmentation
- PyG教程(8):计算更高效的稀疏矩阵形式
- Is flush reliable? Is it safe to open a stock account by mobile phone?
- 使用OneDNS完美解决办公网络优化问题
- postgresql 两个月份,如何计算一共有几个月?
- QT plays audio and video files with errors directshowplayerservice:: dorender: unresolved error code 0x80040266
- Mysql 主从配置
- C leetcode question brushing notes 3- Count the number of items matching the search rule
猜你喜欢
LNMP environment, website cannot be accessed
Degradation technology of template and generic programming
Shopify卖家:分享做社交媒体营销的几个技巧!
使用OneDNS完美解决办公网络优化问题
Automatic Metallic Surface Defect Detection and Recognition with Convolutional NeuralNetworks-论文阅读笔记
Scratch judge leap year electronic society graphical programming scratch grade examination level 4 true question and answer analysis June 2022
关于部署ogg 微服务的一些疑问
Nacos配置管理——配置热更新
巴比特 | 元宇宙每日必读:虚拟人热度减退,有的“出道即巅峰”,围观人群都散了?...
RK3399平台开发系列讲解(进程间通信)14.10、如何查看进程调度的信息
随机推荐
Failed to process package ‘cartographer_ ros‘ :
RK3399平台开发系列讲解(中断篇)13.17、中断处理方式的汇总
瀏覽器調試
零编码制作报表真地可能吗?
shell中的特殊符号
读书笔记-《购物中心》
Nacos configuration management - unified configuration management
12. Talk about the implementation principle of single sign on in the project?
scratch判断闰年 电子学会图形化编程scratch等级考试四级真题和答案解析2022年6月
Live short video source code - the development sequence of live short video source code is five steps
Rk3399 platform development series explanation (interprocess communication) 14.10. How to view process scheduling information
DashboardClient
Qt播放音视频文件报错DirectShowPlayerService::doRender: Unresolved error code 0x80040266
IDEA解决配置文件属性提示消失
QIODevice
QIODevice
浏览器调试
聊一聊 C# 后台GC 到底是怎么回事?
Nacos cluster setup (Reprint)
[Network Research Institute] Microsoft warns against large-scale aitm phishing attacks against more than 10000 organizations