1. 在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0000、0001、0002等主鍵下,查找DriverDesc,內容為你要修改的網卡的描述,如“Realtek RTL8029(AS)-based PCI Ethernet Adapter”。
2. 如果在0001下找到了1中的DriverDesc,在其下,添加一個字符串,命名為NetworkAddress,其值設為你要的MAC地址(注意地址還是連續寫)。如:00E0DDE0E0E0。
3. 然后到其下Ndi\params中添加一項名為NetworkAddress的主鍵,在該主鍵下添加名為default的字符串,其值是你要設的MAC地址,要連續寫,如:000000000000。(實際上這只是設置在后面提到的高級屬性中的“初始值”,實際使用的MAC地址還是取決于在第2點中提到的NetworkAddress參數,這個參數一旦設置后,以后高級屬性中的值就是NetworkAddress給出的值而非default給出的了。)
4. 在NetworkAddress的主鍵下繼續添加名為ParamDesc的字符串,其作用為指定NetworkAddress主鍵的描述,其值可自己命名,如“Network Address”,這樣在網卡的高級屬性中就會出現Network Address選項,就是你剛在注冊表中加的新項NetworkAddress,以后只要在此修改MAC地址就可以了。繼續添加名為Optional的字符串,其值設為“1”,則以后當你在網卡的高級屬性中選擇Network Address項時,右邊會出現“不存在”選項。
5. 重新啟動你的計算機,打開網絡鄰居的屬性,雙擊相應網卡項會發現有一個Network Address的高級設置項,可以用來直接修改MAC地址或恢復原來的地址(選中不存在)。
For Windows 2000/XPMethod 1:This is depending on the type of Network Interface Card (NIC) you have. If you have a card that doesn’t support Clone MAC address, then you have to go to second method.
a) Go to Start->Settings->Control Panel and double click on Network and Dial-up Connections.
b) Right click on the NIC you want to change the MAC address and click on properties.
c) Under "General" tab, click on the "Configure" button
d) Click on "Advanced" tab
e) Under "Property section", you should see an item called "Network Address" or "Locally Administered Address", click on it.
f) On the right side, under "Value", type in the New MAC address you want to assign to your NIC. Usually this value is entered without the "-" between the MAC address numbers.
g) Goto command prompt and type in "ipconfig /all" or "net config rdr" to verify the changes. If the changes are not materialized, then use the second method.
h) If successful, reboot your system.
Method 2:This should work on all Windows 2000/XP systems
a) Go to Start -> Run, type "regedt32" to start registry editor. Do not use "Regedit".
b) Go to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}". Double click on it to expand the tree. The subkeys are 4-digit numbers, which represent particular network adapters. You should see it starts with 0000, then 0001, 0002, 0003 and so on.
c) Find the interface you want by searching for the proper "DriverDesc" key.
d) Edit, or add, the string key "NetworkAddress" (has the data type "REG_SZ") to contain the new MAC address.
e) Disable then re-enable the network interface that you changed (or reboot the system).
Method 3:Use the program Etherchange from http://ntsecurity.nu/toolbox/etherchange/
posted @
2008-08-31 00:16 w2001 閱讀(775) |
評論 (0) |
編輯 收藏
http://www.raytheon.com/newsroom/technology/rtn08_exoskeleton/
posted @
2008-06-06 16:35 w2001 閱讀(152) |
評論 (0) |
編輯 收藏
1. 安裝firefox 2/3,先不要運行
2. 在其各自的快捷方式中添加命令參數"-profilemanager -no-remote"
3. 運行之,在配置文件管理器中分別為ff 2/3創建獨立的配置文件,比方說ff2、ff3
4. 然后,在各自的快捷方式中將命令行參數改為"-p ff2 -no-remote"和"-p ff3 -no-remote"
5. 至此,共存配置完畢,二者可以獨立或同時運行且互不影響....
http://www.blueidea.com/computer/soft/2008/5368.asp
http://www.firefox.net.cn/newforum/viewtopic.php?p=170719
posted @
2008-05-27 02:15 w2001 閱讀(225) |
評論 (0) |
編輯 收藏
1. 安裝TortoiseSVN客戶端
2. 安裝服務器端svn-x.x.x-setup.exe
3. 手工創建svn儲存庫(repository),也可以用TortoiseSVN來做
svnadmin create F:\svn\
4. 配置svn儲存庫,使用密碼,設置用戶名/密碼
編輯/conf/svnserve.conf,
# [general]
password-db = passwd
編輯/conf/passwd,
# [users]
my_id = my_password
5. 手工后臺運行svn服務器,用TortoiseSVN測試一下成功否
svnserve -d -r F:\svn
6. 如果需要將svn配置成windows服務,安裝svnservice最簡單
7. 接下來,用TortoiseSVN簽入簽出吧
8. Apache就免了,不跨平臺開發的話,沒太多用
http://tortoisesvn.tigris.org/http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91http://svnservice.tigris.org/
posted @
2008-05-18 18:46 w2001 閱讀(392) |
評論 (0) |
編輯 收藏
1. 啟用內存泄漏檢測#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
當退出程序位置固定時,用:
_CrtDumpMemoryLeaks();
定義了_CRTDBG_MAP_ALLOC 時,會顯示內存塊類型和內存塊分配編號(在大括號內)。
當退出位置不固定時,用:
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
該語句在程序退出時自動調用 _CrtDumpMemoryLeaks。必須同時設置 _CRTDBG_ALLOC_MEM_DF 和 _CRTDBG_ALLOC_MEM_DF 兩個位域。
2. 內存塊類型“普通塊”是由程序分配的普通內存。
“客戶端塊”是由 MFC 程序用于需要析構函數的對象的特殊類型內存塊。MFC new 操作根據創建對象的需要創建普通塊或客戶端塊。
“CRT 塊”是由 CRT 庫為自己使用而分配的內存塊。CRT 庫處理這些塊的釋放,因此您不大可能在內存泄漏報告中看到這些塊,除非出現嚴重錯誤(例如 CRT 庫損壞)。
3. 內存泄露定位 - 在內存分配編號上設置斷點先通過_CrtDumpMemoryLeaks查到泄露的內存塊分配號n,然后添加語句
_CrtSetBreakAlloc(n);
Debug程序運行后,將自動斷點至分配處
4. 內存狀態比較_CrtMemCheckpoint( &s1 );
// memory allocations take place here
_CrtMemCheckpoint( &s2 );
if ( _CrtMemDifference( &s3, &s1, &s2) )
_CrtMemDumpStatistics( &s3 );
5. CRT內存泄露誤報在某些情況下,_CrtDumpMemoryLeaks 可能給出錯誤的內存泄漏指示。如果使用將內部分配標記為 _NORMAL_BLOCK 而不是 _CRT_BLOCK 或 _CLIENT_BLOCK 的庫,則可能發生這種情況。其結果是,_CrtDumpMemoryLeaks 無法區分用戶分配和內部庫分配。如果庫分配的全局析構函數在您調用 _CrtDumpMemoryLeaks 的位置之后運行,則每個內部庫分配都被作為內存泄漏進行報告。Visual Studio .NET 之前的早期版本的標準模板庫會導致 _CrtDumpMemoryLeaks 報告這樣的錯誤指示,但在最新版本中此問題已經得到解決。
posted @
2008-05-10 04:40 w2001 閱讀(702) |
評論 (0) |
編輯 收藏
OpenGL VBO并不難,但是較繁瑣,其實其概念跟加載紋理是一樣的:
初始化階段:
1.
glGenBuffersARB(1, &nVBOVertices); //生成一個句柄
2.
glBindBufferARB(GL_ARRAY_BUFFER_ARB, nVBOVertices); //聲明該句柄為一個vbo句柄,并選擇之
3.
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(vertices), vertices,GL_STATIC_DRAW); //將頂點集上傳至server端
使用階段:
1.
glEnableClientState(GL_VERTEX_ARRAY); //開始使用vbo
2.
glBindBufferARB(GL_ARRAY_BUFFER_ARB, nVBOVertices); //選擇當前使用的vbo
3.
glVertexPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(0)); //指定vbo頂點格式
4.
glDrawArrays( GL_TRIANGLES, 0, g_pMesh->m_nVertexCount ); //畫吧
5.
glDisableClientState(GL_VERTEX_ARRAY); //停止使用vbo
收尾階段:
1.
glDeleteBuffersARB(1,&nVBOVertices); //刪除句柄,同時刪除server端頂點緩沖
再來看看紋理緩沖是怎么使用的,其實差不多:
初始化階段:
1.
glGenTextures(1, &texID);//創建句柄
2.
glBindTexture(GL_TEXTURE_2D, texID); //設置句柄類型
3.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img->GetWidth(), img->GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, raw_rgba); //上傳紋理緩沖
使用階段:
1.
glEnable(GL_TEXTURE_2D); //開始使用紋理緩沖
2.
glBindTexture(GL_TEXTURE_2D, texID); //選擇當前使用的紋理緩沖
3. 發送頂點和紋理坐標,畫吧...省略
4.
glDisable(GL_TEXTURE_2D); //停止使用紋理
收尾階段:
1.
glDeleteTextures(1,&texID);//刪除句柄,,同時刪除server端緩沖
看到了么,這個概念是不是很相似?都是:
1. 創建句柄
2. 設置句柄類型
3. 上傳數據
4. 開始使用緩沖
5. 選擇句柄
6. 使用緩沖
7. 停止使用緩沖
8. 刪除句柄和緩沖
posted @
2008-05-10 00:31 w2001 閱讀(8236) |
評論 (4) |
編輯 收藏
Jack Ritter, "An Efficient Bounding Sphere" in Graphic Gems (1990)
1. 在三維點集S中找到較遠的兩點,構成一個初始包圍球估計B0。該球可以如是求:遍歷S,求出其中x坐標最大/最小、y最大/最小及z最大/最小的3對點,然后取其中距離最大的一對,以其二點連線中點為球心C0,距離的一半為初始半徑R0
2. 然后再次遍歷S,逐一測試S中其他點是否處于B中;
3. 如果點Pk處于Bk中,則繼續測試下一個點Pk+1
4. 如果Pk不處于Bk中,則:作Bk的球心Ck與Pk的連線矢量(Ck,Pk),并反向延長至與Bk相交,交點為Qk,以連線(Qk,Pk)的中點為新的球心Ck+1,其距離的一半為新的球半徑Rk+1,構成新的包圍球Bk+1,不難發現,Bk與Bk+1相切于Qk處
5. 上述過程迭代至所有S中的P點遍歷完為止。以上近似算法可擴展到n維空間。
6. 該算法特點:快速,且包圍球幾乎最小,雖不能保證絕對最小,但絕對優于基于包圍盒算出來的解

According to Jack Ritter a near-optimal sphere can be created by:
1) Finding the minimal and maximal vertices along each axis (x,y,z).
2) For those three pairs chose the one pair which has the largest distance.
3) The center of the sphere is the midpoint between those two vertices and its radius is half the distance between them.
4) Go through all vertices again, if you find a vertex whose distance (d) is greater than the radius (r), move the sphere towards this vertex by (d-r)/2 and then set the new sphere radius to (d+r)/2.
posted @
2008-05-05 02:32 w2001 閱讀(1001) |
評論 (0) |
編輯 收藏
glut/glew簡單配置1. 所有lib,丟C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib
2. 所有.h,丟C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\gl
3. 所有.dll和bin,丟C:\WINDOWS\system32
4. 把項目的Unicode去掉,包括Debug和Release(for glut)
5. 項目預編譯頭文件里面,添:
#include <GL/glew.h>
#include <GL/glut.h>
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glew32.lib")
#pragma comment(lib,"glut.lib")
#pragma comment(lib,"glut32.lib")
6. 開始玩....進一步參考簡單glut及glew程序模板
CxImage在OpenGl中的應用
注意,不能將CxImage::GetBits()直接用于OpenGL,否則會:
1. 紋理上下顛倒
2. 紋理中像素點格式為BGR
3. 不能用于GL_RGBA,只能GL_RGB,GetBits獲取不到Alpha分量
如果一定要用CxImage::GetBits(),必須進行如下操作:
1. CxImage::SwapRGB2BGR()
2. CxImage::Flip()
推薦在OpenGl全用CxImage::Encode2RGBA獲取Bitmap,用了之后啥麻煩事都沒了.....
posted @
2008-05-01 16:24 w2001 閱讀(1903) |
評論 (1) |
編輯 收藏
First, think what you want these matrices do.
Let we have transformation matrices A and B . We want to transform vector V by both and get vector V'.
But above is not enough to specify what we want to do, as
first transform by A then transform by B
and
first transform by B then transform by A
are different. You can just try to play with rotations in real world.(get a cube, paint x,y,z on sides, etc.)
Now, more on how it's done:
first transform by A then transform by B
It is easy to see that this is accomplished by:
In openGL's convention:
V'=B*(A*V)
Note that it is same as
V'=(B*A)*V
so you can do it as
C=B*A;
V'=C*V;
In DX's convention:
V'=(V*A)*B
C=A*B;
V'=V*C;
(note: real operations done on memory is the same. It's just matter how we map matrix indices to memory)
As you see, V*A*B and B*A*V is kind of symmetrical. Same for consequently applied transforms like V*A*B*C*D*E*F or F*E*D*C*B*A*V
Now, write it down for "transform by B then transform by A" yourself to remember it better.
When you render something , you want points to be transformed by
matrix of object
matrix of parent object
matrix of grandparent object ...
matrix of camera
(and done by API, projection matrix)
From there you can find what order of multiplications you want. In OGL, you need to
m=matrix_of_camera*matrix_of_grandparent_objectmatrix_of_parent object*matrix_of_object;
...
then if you'll glLoadMatrix, OpenGL will do
vertice=m*vertice;
Some more notes: Let you have spacecraft with spacecraft-to-world matrix M
And you use OpenGL convention.
For example, to turn spacecraft around spacecraft's local X direction, you need to
M=M*axis_angle_to_matrix(Vector(1,0,0),angle);
(note: you need to reorthonormalize matrix if you do that incrementally)
To turn spacecraft around global X direction, you need to
M=axis_angle_to_matrix(Vector(1,0,0),angle)*M;
On openGL:
This sequence
glMatrixMode(GL_MODELVIEW);
glMultMatrix(A);
glMultMatrix(B);
glMultMatrix(C);
... render your mesh ...
works as if your mesh would be transformed by C,then B, then A
It makes lot of sense, if you for example want to render a robot with
matrices giving positions of child nodes (fingers) relativelty to
parent (arm), and arm are responsible for positioning fingers, you can
do
RenderArm(){
glPushMatrix();
glMultMatrix(matrix_of_first_finger);
RenderFinger();
glPopMatrix();
glPushMatrix();
glMultMatrix(matrix_of_second_finger);
RenderFinger();
glPopMatrix();
}
and so-on(simplified example)
Then, you can have
glPushMatrix();
glMultMatrix(matrix_of_arm);
RenderArm();
glPopMatrix();
and it will work properly.
If you have more questions, ask.
posted @
2008-04-30 22:05 w2001 閱讀(1401) |
評論 (2) |
編輯 收藏
等待
完美生活
posted @
2008-02-06 22:49 w2001 閱讀(141) |
評論 (0) |
編輯 收藏