Sty
zzkathy · 共 27 篇文章
Mogre学习笔记(七)
Section 7: Skeleton animation 今天试图添加多个模型的骨骼动画,出了一些问题,郁闷了一上午之后终于找到了问题所在,下面我们就首先给出Tutorial上的一段代码,看看如何使用骨骼动画,再说说我遇到的问题吧n_n using System; using System.Drawing; using Math3D; using OgreDotNet; using System.Collections.Generic; namespace OgreDotNetTutorial { public class MoveDemoApplication : ExampleAppl…
2008-08-06 15:58 · 评论(0)
Mogre学习笔记(六)
Section 6: load configurations manually 有时候由于某些原因,会需要去掉OGRE项目的配置文件,这时我们就需要在代码中hardcode,以定义这些资源。 我们在新建Root对象的时候,如果不设置参数,那么它会默认读取resource.cfg和plugins.cfg中的配置信息。因此,我们新建Root对象的时候应该使用如下代码: new Root("", ""); 这样,我们就可以在之后的代码中手动定义了,首先是定义resource.cfg: ResourceGroupManager.Singleton.AddResourceLocation(archNa…
2008-08-06 15:56 · 评论(0)
Mogre学习笔记(五)
Section 5: Embed Ogre in a Windows.Forms window 很多时候,我们需要把Ogre放到一个Windows.Form中,以方便使用,下面给出代码先: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Mogre; namespace Tutorial06 { pub…
2008-07-31 15:56 · 评论(0)
Mogre学习笔记(四)
Section 4: The Ogre startup sequence 在我们写自己的Ogre应用前,必须知道Ogre有一个特殊的启动顺序。他主要分为以下7步: 生成一个Root对象 定义资源:ResourceGroupManager.Singleton.AddResourceLocation(location, type, group) 设置RenderSystem 生成RenderWindow 初始化资源组(Resource Group) 建立场景 Rander循环:这里用的是StartRendering 具体代码如下,F5运行即可: using System; using Syste…
2008-07-31 15:55 · 评论(0)
Mogre学习笔记(三)
Section 3: Frame Listeners and Windows.Forms Input FrameListener,是Ogre最有用的部分,下面我们就先来看一下代码: using System; using System.Collections.Generic; using System.Windows.Forms; using MogreFramework; using Mogre; using System.Drawing; namespace Tutorial04 { static class Program { [STAThread] static void Main(…
2008-07-31 15:53 · 评论(0)
Mogre学习笔记(二)
Section 2: Terrain, Sky, Fog, and the Root object 还是先给出代码: using System; using System.Windows.Forms; using MogreFramework; using Mogre; namespace Tutorial03 { static class Program { [STAThread] static void Main() { try { MyOgreWindow win = new MyOgreWindow(); new SceneCreator(win); win.Go(); } catc…
2008-07-31 15:47 · 评论(0)
控制CPU曲线
写一个程序,让用户来决定Windows任务管理器(Task Manager)的CPU占用率。程序越精简越好,计算机语言不限。例如,可以实现下面三种情况: 1. CPU的占用率固定在50%,为一条直线; 2. CPU的占用率为一条直线,但是具体占用率由命令行参数决定(参数范围1~ 100); 3. CPU的占用率状态是一个正弦曲线。 分析与解法 有一名学生写了如下的代码: while (true) { if (busy) i++; else } 然后她就陷入了苦苦思索:else干什么呢?怎么才能让电脑不做事情呢?CPU使用率为0的时候,到底是什么东西在用CPU?另一名学生花了很多时间构想如何“…
2008-07-29 10:04 · 评论(0)
Mogre学习笔记(一)
Mogre,也就是Managed OGRE,它对OGRE(在上一篇ORGE学习笔记中有简单介绍)做了一个封装,使得其可以使用C#进行开发。对于我这种写惯Java,见过C#,对C++有强烈恐惧心理的人来说,不得不说是一个很好的选择。 因为它只是对OGRE做了一个封装,所以,除了在coding时,让我觉得更好用以外,结构、接口之类是完全一致的,在此不再多说。 Tutotial的地址: http://www.ogre3d.org/wiki/index.php/MOGRE 下面对Mogre的一些简单使用,分篇进行一些记录和介绍 Section 1: The SceneNode, Entity, Sc…
2008-07-22 23:57 · 评论(0)
OGRE学习笔记
OGRE,全称Object-Oriented Graphics Rendering Engine,让你可以在应用程序中采用面向对象的方式来表现复杂3D的空间。 它3D图形的应用程序提供了“强大的动力”,进而允许更多关注应用程序细节而不是一个3D场景的渲染过程。作为应用程序的中间件,OGRE扮演了一个专注于处理了三维空间场景的角色,使我们可以用很少量的代码来构建一个完整的三维场景。 下面的这张UML图表展现了OGRE中的核心对象以及它们之间是如何互相联系的,这张图表并没有描述所有的类,它只把几个关键的类彼此间是如何关联的作了一个大概的描述。 在这张图表的最顶部是根(Root)对象。这是你进入O…
2008-07-18 09:05 · 评论(0)
MFC入门(一)
原作者 zhoujiamurong zhoujiamurong@163.com 来源 http://www.vchelp.net 该文章为学习了C和C++以及有SDK编程基础的,但还未学习MFC的人员使用,我们开始使用一个基本的内容开始: 全部的代码如下: #include <afxwin.h> class sample:public CFrameWnd { public: sample() { Create(NULL,"MFC Window"); MessageBox("My MFC Window","CFrame constructor",MB_OK); } }; class App:p…
2008-07-09 14:23 · 评论(0)
Struts2与Struts1.x的深度比较
原作者:sterning 地址: http://www.blogjava.net/sterning/archive/2007/07/17/130892.html Struts作为MVC 2的Web框架,自推出以来不断受到开发者的追捧,得到广泛的应用。作为最成功的Web框架,Struts自然拥有众多的优点:MVC 2模型的使用、功能齐全的标志库(Tag Library)、开放源代码。 但是,正所谓“没有最好,只有更好”,Struts1.x自身也有不少的缺点:需要编写的代码过多,容易引起“类爆炸”、单元测试困难。这些缺点随着Web的发展越来越明显。这就促生了Struts 2,它的诞生能很好的解决…
2008-07-09 13:04 · 评论(0)
How to auto build and deploy project
How to auto build and deploy project <o:p></o:p> 1 Prepare software environment <o:p></o:p> 1.1 copy “apache-ant- <st1:chsdate isrocdate="False" month="12" islunardate="False" day="30" w:st="on" year="1899"> 1.7.0 </st1:chsdate> ” to your computer****<o:p></o:p> For example: C:\apache-ant-<st1:chsd…
2008-03-06 10:09 · 评论(0)
ant学习笔记(七)
因为某些需求,今天尝试着使用ant中的<mail>task发送邮件,提醒相关人员build成功完成。脚本很简单,摘录ant中的example如下: <mail mailhost="somehost@xyz.com" mailport="25" subject="Build successful" charset="utf-8"> <from address="me@myist.com"/> <to address="all@xyz.com"/> <message>some international text</message> </mail> 上午运行的时候没有什么问题,但是下午传到Cla…
2008-01-11 16:05 · 评论(0)
ant学习笔记(六)
今天写了一段ant脚本,是用来编译,打包,运行java的。具体如下: <target name="compile"> <javac srcdir="${src}" destdir="${bin}" source="1.4" encoding="UTF-8" deprecation="on" failonerror="true" > <classpath> <fileset dir="${lib}"> <include name="*.jar"/> </fileset> </classpath> </javac> </target> <target name="makejar" depends…
2008-01-09 15:32 · 评论(0)
ant学习笔记(五)
今天喵喵使用ant给一个eclipse plugin打build,下面是具体脚本代码。只需要稍作改动即可完成其他plugin的build工作:包括把xxx改成相应的项目名称,filecopy那段的改写等等n_n。 <?xml version="1.0" encoding="UTF-8" ?> <!-- ==================================================== Can be used as a base for any Eclipse Plugin's build with a bit of work. Date: 2008.1.7 Author…
2008-01-08 17:24 · 评论(0)