随笔分类 -  C/C++/VC++

上一页 1 2 3 4 5 6 ··· 12 下一页

简单搜索题:马的走法
摘要:一个4×5的棋盘,输入马的起始坐标,求马能返回初始位置的所有不同走法的总数(马走过的位置不能重复,马走“日”字)。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include using namespace std; c... 阅读全文

posted @ 2008-11-12 20:36 Phinecos(洞庭散人) 阅读(1021) 评论(0) 推荐(0) 编辑

MFC同源子窗口的实现
摘要:MFC里的静态拆分窗口是一种很有意思的效果,但它们毕竟不是独立的窗口,还框在一个大窗口中, 那么要使用真正完全独立的窗口怎么做呢?本文参考侯捷的《深入浅出MFC》的第13章的思路,实现了多个独立的视图窗口,代码如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHig... 阅读全文

posted @ 2008-11-12 19:05 Phinecos(洞庭散人) 阅读(1560) 评论(1) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 19 Creating a Virtual Reality Walkthrough Application
摘要:本文是整个系列文章的最后一篇,将创建一个完整的虚拟office应用程序(如图所示)来做为ending. 1,在CCY457OpenGLView类中加入下述变量,用来保存office内各个物体的显示列表 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter... 阅读全文

posted @ 2008-11-07 16:39 Phinecos(洞庭散人) 阅读(5457) 评论(5) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 18 Reading objects from the OBJ File Format
摘要:本文将介绍如何从Obj文件格式中创建3D对象,我们使用的是Nate Miller的obj格式加载类。 This would be very useful to create large Virtual Reality applications as we could make use of the readily available 3D model files or make ... 阅读全文

posted @ 2008-11-07 16:06 Phinecos(洞庭散人) 阅读(5111) 评论(9) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 17 Shadows
摘要:Shadows Conceptually drawing a shadow is quite simple. A shadow is produced when an object keeps light from a source from striking some object or surface behind the object, casting the shad... 阅读全文

posted @ 2008-11-07 15:33 Phinecos(洞庭散人) 阅读(3915) 评论(12) 推荐(1) 编辑

《基于MFC的OpenGL编程》Part 16 Reflection
摘要:Reflections Adding reflections to a program too can improve its realism to a great extent. Here we'll look at a simple method to create reflection where we simply redraw the object with an appropr... 阅读全文

posted @ 2008-11-07 14:58 Phinecos(洞庭散人) 阅读(2857) 评论(1) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 15 Selection
摘要:Selection Selection is a powerful feature of OpenGL that allows you click at some position of the OpenGL window using the mouse and determine which of your objects lie beneath it. The act of selecting... 阅读全文

posted @ 2008-11-07 14:29 Phinecos(洞庭散人) 阅读(3461) 评论(1) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 14 Quadrics
摘要:本文在第11篇文章的基础上,为其加入显示各种二次曲面的代码; Quadrics Every quadric has a few settings associated with it. We have to create a quadric first and then customize its settings to render the shape we want. ... 阅读全文

posted @ 2008-11-06 17:12 Phinecos(洞庭散人) 阅读(2767) 评论(0) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 13 Creating 2D and 3D Text
摘要:wglUseFontBitmaps函数 The wglUseFontBitmaps() function creates a set of bitmap display lists based on the glyphs in the currently selected font in the current DC for use in the current OpenGL RC. It bas... 阅读全文

posted @ 2008-11-06 16:47 Phinecos(洞庭散人) 阅读(3858) 评论(0) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 12 Creating and Using Display Lists
摘要:本文对第11篇文章进行修改,使用显示列表来存储渲染命令。 显示列表 OpenGL provides a facility to create a preprocessed set of OpenGL commands called a display list. Creating a display list is a straight forward process. We jus... 阅读全文

posted @ 2008-11-06 16:14 Phinecos(洞庭散人) 阅读(2898) 评论(2) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 11 Blending, Antialiasing and Fog
摘要:Blending and Transparency Blending in OpenGL provides pixel-level control of RGBA color storage in the color buffer. To enable blending we must first call glEnable(GL_BLEND). We have to set up the ble... 阅读全文

posted @ 2008-11-06 11:41 Phinecos(洞庭散人) 阅读(3037) 评论(0) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 10 Texture Mapping
摘要:本文在第9篇文章的基础上,为立方体加入纹理映射的功能。 Texture Mapping Texture Mapping in OpenGL is a fairly straightforward concept. Every texture is nothing but an image of some sort. Texture mapping is basically applyin... 阅读全文

posted @ 2008-11-05 22:06 Phinecos(洞庭散人) 阅读(5245) 评论(5) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 9 Lighting
摘要:本文在第8篇文章的基础上,为其加入灯光效果。 Materials OpenGL materials are description of what objects are made of. It basically specifies how much of light they reflect and this is what we would be seeing. OpenGL li... 阅读全文

posted @ 2008-11-05 21:04 Phinecos(洞庭散人) 阅读(4334) 评论(7) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 8 Colors
摘要:OpenGL支持两种颜色模式:RGBA和颜色索引模式,本文关注于前者。 Smooth Shading and Flat Shading When Smooth Shading is specified, the color values are interpolated between vertices. If Flat Shading is specified, one verte... 阅读全文

posted @ 2008-11-05 20:35 Phinecos(洞庭散人) 阅读(4125) 评论(2) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 7 Animation
摘要:本文中将对第5篇文章的太阳系模型进行修改,加入一些动画效果。此外还会加入显示帧速率的代码。 加入动画效果最容易的方法是响应WM_TIMER消息,在其消息处理函数中改变一些参数值,比如每过多少毫秒就旋转一定的角度,并且重绘场景。 Frame Rate Frame rate is nothing but the number of frames that can be ren... 阅读全文

posted @ 2008-11-05 20:12 Phinecos(洞庭散人) 阅读(6331) 评论(41) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 6 Keyboard and Mouse Control
摘要:在上一篇的基础上加入对键盘和鼠标的事件处理程序,以便用其来控制3D物体的旋转和移动。 1,首先在CCY457OpenGLView类中为WM_KEYDOWN, WM_LBUTTONDOWN, WM_LBUTTONUP 和 WM_MOUSEMOVE四个事件加入事件处理函数。 2,在CCY457OpenGLView.h中加入下列用于控制旋转和移动的变量: Code highlighti... 阅读全文

posted @ 2008-11-05 16:42 Phinecos(洞庭散人) 阅读(6723) 评论(3) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 5 Transformations - Rotations, Translations and Scaling
摘要:Transformations - Translation, Rotation and Scaling Translation is nothing but moving along an arbitrary axis. Rotation is spinning about an arbitrary axis. Scaling is increase or decrease in size alo... 阅读全文

posted @ 2008-11-05 16:12 Phinecos(洞庭散人) 阅读(6279) 评论(2) 推荐(0) 编辑

《基于MFC的OpenGL编程》Part 4 Drawing Simple 3D objects
摘要:视见体 Viewing Volume is nothing but the region of 3D Cartesian space in that will occupy the window. It is nothing but the minimum and maximum x, y and z values that are inside the window. So if a verte... 阅读全文

posted @ 2008-11-05 15:48 Phinecos(洞庭散人) 阅读(8841) 评论(14) 推荐(2) 编辑

《基于MFC的OpenGL编程》Part 3 Drawing Simple 2D Shapes
摘要:剪裁区域 In OpenGL when you create a window to draw in we must specify the coordinate system we want to use and how to map the specified coordinates into physical screen coordinates. We would be usin... 阅读全文

posted @ 2008-11-05 15:07 Phinecos(洞庭散人) 阅读(9329) 评论(10) 推荐(2) 编辑

《基于MFC的OpenGL编程》系列文章
摘要:《基于MFC的OpenGL编程》系列文章 阅读全文

posted @ 2008-11-05 10:50 Phinecos(洞庭散人) 阅读(28477) 评论(2) 推荐(7) 编辑

上一页 1 2 3 4 5 6 ··· 12 下一页

导航