Axiom3D学习日记 3.Cameras, Lights, and Shadows
Camera 相机:
相机基础知识不写了,需要注意的是:axiom目前不支持同时操作多个相机.
创建,设置位置基本操作.
_camera = _scene.CreateCamera("MainCamera");
_camera.Position = new Vector3(, , );
_camera.LookAt(Vector3.Zero);
_camera.Near = 5;决定了相机可视范围.
ViewPort(视口)
当要显示多个窗口时候用,这个我不怎么需要,就不写了.
Shadows in Axiom(重点来了)
Axiom有3种不同阴影.
- 纹理阴影:计算成本最低的一种.
- Modulative Stencil Shadows:较第三种没那么密集
- Additive Stencil Shadows:会叠加计算每个灯光的阴影,对GPU来说是比较大的负担.
遗憾的是:Axiom不支持软阴影,如果需要软阴影,需要自己写顶点和片段程序.
使用阴影非常容易:
scene.AmbientLight = ColorEx.Black;
scene.ShadowTechnique = ShadowTechnique.StencilAdditive; Entity ent = scene.CreateEntity("ninja", "ninja.mesh");
ent.CastShadows = true;
scene.RootSceneNode.CreateChildSceneNode().AttachObject(ent);
灯光:
灯光类型:
- Point (LightType.Point) - 点光源,各个方向.
- Spotlight (LightType.Spotlight) - 聚光灯
- Directional (LightType.Directional) - 平行光
创建灯:
Light pointLight = scene.CreateLight("pointLight");
pointLight.Type = LightType.Point;
pointLight.Position = new Vector3(, , );
pointLight.DiffuseColor = ColorEx.Red;
pointLight.SpecularColor = ColorEx.Red;
Light spotLight = scene.CreateLight("spotLight");
spotLight.Type = LightType.SpotLight;
spotLight.DiffuseColor = ColorEx.Blue;
spotLight.SpecularColor = ColorEx.Blue;
spotLight.Direction = new Vector3(-, -, );
spotLight.Position = new Vector3(, , );
Axiom3D学习日记 3.Cameras, Lights, and Shadows的更多相关文章
- Axiom3D学习日记 5.Frame Listeners, and Input Handling
Frame Listeners In Ogre's C++, we would register a class to receive notification before and after a ...
- Axiom3D学习日记 4.地形,天空,雾
首先需要引用Axiom.SceneManagers.Octree.dll. 地形: 载入地形配置,从一个文件中. scene.LoadWorldGeometry( "Terrain.xml& ...
- Axiom3D学习日记 0.Axiom基础知识
Axiom 3D Engine An open-source, cross-platform, managed 3D rendering engine for DirectX, XNA and Ope ...
- Axiom3D学习日记 2.介绍SceneManager,SceneNode,Entity
SceneManager(场景管理类) 所有出现在屏幕里的东西都受SceneManager管理(最好是这样),当你放置对象在场景里,SceneManager就会跟踪他们的位置,当你为场景创建一个相机, ...
- Axiom3D学习日记 1.程序配置
1.需要引用的库 Axiom Axiom.Framework Axiom.Platforms.Win32 Axiom.Plugins.FreeImageCodecs Axiom.Plugins.Par ...
- Linux学习日记-使用EF6 Code First(四)
一.在linux上使用EF 开发环境 VS2013+mono 3.10.0 +EF 6.1.0 先检测一下EF是不是6的 如果不是 请参阅 Linux学习日记-EF6的安装升级(三) 由于我的数据库 ...
- android学习日记05--Activity间的跳转Intent实现
Activity间的跳转 Android中的Activity就是Android应用与用户的接口,所以了解Activity间的跳转还是必要的.在 Android 中,不同的 Activity 实例可能运 ...
- android学习日记03--常用控件Dialog
常用控件 9.Dialog 我们经常会需要在Android界面上弹出一些对话框,比如询问用户或者让用户选择.这些功能我们叫它Android Dialog对话框 对话框,要创建对话框之前首先要创建Bui ...
- android学习日记03--常用控件checkbox/radiobutton
常用控件3.checkbox 复选框,确定是否勾选,点击一下勾选,点击第二下取消,当有一系列备选项时适合用checkbox控件,方便用户提交数据. 贴上例子Activity的java代码 packag ...
随机推荐
- Android假退出不是流氓行为
转自Android假退出不是流氓行为 关于Android程序的退出,目前我们没有再用System.exit(0)或killProcess的机制而是直接用Activity.finish假退出了.因此在内 ...
- Junit4学习笔记
一.初始化标注 在老Junit4提供了setUp()和tearDown(),在每个测试函数调用之前/后都会调用. @Before: Method annotated with @Before exec ...
- Android ServiceConnection类的onServiceDisconnected(ComponentName name)在什么时候执行
ServiceConnection类中的两个方法非别在服务连接成功时.不成功时调用.其中onServiceDisconnected()方法在连接正常关闭的情况下是不会被调用的, 该方法只在Servic ...
- Android4.0窗口机制和创建过程分析
一 前言 在谈到这个话题的时候,脑海里面千头万绪,因为它涉及到了方方面面的知识… 比如Activity管理,窗口添加,Token权限验证等等… 既然这么复杂,那么我们就复杂的问题简单化,可以分成下面 ...
- [LeetCode#246] Missing Ranges Strobogrammatic Number
Problem: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked a ...
- 分布式文件系统FastDFS安装与配置(单机)
安装包如下:fastdfs-nginx-module_v1.16.tar.gzFastDFS_v5.05.tar.gzlibfastcommon-master.zipnginx-1.8.0.tar.g ...
- poj 2151
http://poj.org/problem?id=2151 Check ...
- 排序之直接插入排序(Straight Insertion Sort)
一.直接插入排序(Straight Insertion Sort) 排序的过程如下:给定无需序列:(3,6,9,7,1,8,2,4) ① 3,6,9,7,1,8,2,4 (将6插入到有序序列3中) ② ...
- ubuntu制作usb启动盘
准备: u盘 iso镜像文件--ubuntu-12.04.2-desktop-amd64.iso 烧盘软件--unetbootin-linux-583 步骤: 格式化u盘 查看u盘信息 #mount/ ...
- [cocos2dx 3.0 + ios]如何编写iAd的plugin
cocos2dx3.0自带的plugin包含推广,收益等各个方面的第三方插件,但是对iAd没有支持,大概是因为专属于IOS,没有单独成库的必要,不过为了统一使用广告的插件化管理,封装一个专属IOS的I ...