2014年2月19日 星期三

C++ 延伸介面也延伸實作

在 C++ 中若要增加一個介面類別的功能,就得從這個介面類別再延伸出一個新介面類別,在其中增加新功能,但這要實作可麻煩了,還得把舊介面所宣告的功能再寫一次,以下這範例的做法可省去這層麻煩,不過得有舊實作的原始碼才行。

注意對介面的繼承須加一個 virtual


 1 #include <iostream>
 2  
 3  using namespace std;
 4  
 5  // 介面
 6  class IBase
 7  {
 8  public:
 9    IBase(){}
10    virtual ~IBase(){}

2014年2月12日 星期三

WD WD10EZEX-08M2NA0 和 NVIDIA IDE SW 相衝

剛買了一顆 WD WD10EZEX-08M2NA0 硬碟,在 WinXP 下看不到,但用 WinXP 安裝光碟是看得到的,索性就把 WinXP 安裝到這顆硬碟,一開始一切正常,但安裝完一堆驅動程式後就開不了機了。

想說一個個找原因很麻煩,只好假設是儲存方面的驅動程式,重裝一次 WinXP,但沒裝 NVIDIA IDE SW,果然被我猜中。

為了進一步確認,一切裝好後,設好系統還原,再裝上 NVIDIA IDE SW,重開機後就進不了 WinXP 了,證明無誤。

只有 WinXP 的 NVIDIA IDE SW 有影響,在 Win7 無影響。





2014年2月4日 星期二

讓 KGS 落子有聲的 java 版本

在 KGS 下圍棋落子沒聲,經不斷嘗試,找到可讓 KGS 落子有聲的最新版本為

 Java SE Runtime Environment 6u31


先點 Accept License Agreement 再抓,註冊完就能抓取





2013年12月14日 星期六

OpenGL 呼叫擴增函數出現 Memory violation

一般 if(glewInit() != GLEW_NO_ERROR) 正確後就可以使用擴增函數(比如 glGenBuffers()),但若是將 glew.c 加入專案中,或是把 glew.c 編譯成靜態程式庫來使用,就得須把用到 OpenGL 的每個模組(exe 和 dll)都要呼叫一次 glewInit(),還有要記得在主程式(exe)已先做好 opengl context,才能讓 glewInit() 成功執行。

glewInit() 主要任務在從驅動程式中把擴增函數的位址抽出來,放好到函數指標供應用程式使用。

另外若是直接使用  glew.c 或靜態程式庫,還得在專案中加上前置識別字 GLEW_STATIC。



2013年11月17日 星期日

photoshop 中英對照

File 文件
1.New 新建
2.Open 打開
3.Open As 打開為
4.Open Recent 最近打開文件
5.Close 關閉
6.Save 存儲
7.Save As 存儲為
8.Save for Web 存儲為Web所用格式
9.Revert 恢復
10.Place 置入
11.Import 輸入
1 PDF Image PDF圖像導入
2 Annotations 注釋
12.Export 輸出
13.Manage Workflow 管理工作流程
1 Check In 登記
2 Undo Check Out 還原註銷
3 Upload To Server 上載到伺服器
4 Add To Workflow 添加到工作流程
5 Open From Workflow 從工作流程打開
14.Automate 自動
1 Batch 批次處理
2 Create Droplet 創建快捷批次處理
3 Conditional Mode Change 條件模式更改
4 Contact Sheet 聯繫表
5 Fix Image 限制圖像
6 Multi Page PDF to PSD 多頁面PDF檔到PSD檔
7 Picture package 圖片包
8 Web Photo Gallery Web照片畫廊
15.File Info 文件簡介
16.Print Options 列印選項
17.Page Setup 頁面設置
18.Print 列印
19.Jump to 跳轉到
20.Exit 退出
Edit 編輯

2013年10月27日 星期日

ODE教學<四>矩陣資料

The Matrix Details



The ODE library uses a 3x3 matrix in mathematical notation, i.e. row first, column second. However, internally ODE stores
its matrices as a 4x4 ordered matrix, padded with 0's. The good news is that the dBodyGetRotation function we used to 
retrieve the rotation matrix in DrawGeom above returns a 4x3 rotation matrix. So the ODEtoOGL function transposes the
elements over to the OpenGL order (column first, row second) and plugs in the position vector into the 12th, 13th and
14th elements. 

ODE教學<三>幾何繪圖

Drawing The Geoms

At the end of the SimLoop function, after advancing the simulation one step and then deleting the contact joints, we called a function called DrawGeom. This function serves as a generic rendering routine for all types of geoms, using a different rendering function for each class of geom. In keeping with the examples that came with the ODE library, the DrawGeom function takes four parameters. The first is the geom's ID, then its position vector, rotation matrix and lastly a flag used to toggle the rendering of the geoms axis aligned bounding box.