Anyway, writing 3D real-time programs from the ground up, although high, but huge trouble, ogre and physx have been quite mature in the past two years, rapid development is no better. but it is a little complicated to integrate. Record it here for future reference.
Ogre SDK vc8 version (I once tried to hard convert the SDK of vc7 into a project of vc8, and the result can be compiled in the past, but the execution crashes the machine, Khan)
Physx SDK v2.4.1 is now working on hardware...
Test and modify project: Sample project demo_camera_track
Add Project Properties
C/C ++ (installed in this directory by default ):
C:/program files/ageia technologies/ageia physx SDK/v2.4.1/sdks/Foundation/include
C:/program files/ageia technologies/ageia physx SDK/v2.4.1/sdks/physics/include
C:/program files/ageia technologies/ageia physx SDK/v2.4.1/sdks/physxloader/include
Linker:
Add the directory of the additional library: C:/program files/ageia technologies/ageia physx SDK/v2.4.1/sdks/lib/Win32
Add additional dependencies: physxloader. Lib
Add the header file in cameratrack. cpp:
# Include "nxphysics. H" (it must start with or hundreds of errors !!)
Then add the initialization, exit the physx function, and call physx that's it in the callback.
Here, a box is used. I am wondering why scenenode * cannot convert objects to the world using a 44 matrix.
Two functions .....:
// Float glmat [16];
// Actor-> getglobalpose (). getcolumnmajor44 (glmat );
Nxvec3 cubepos = actor-> getglobalposition ();
Cubenode-> setposition (cubepos. X, cubepos. Y, cubepos. z );
Nxquat cubequat = actor-> getglobalorientationquat ();
Cubenode-> setorientation (cubequat. W, cubequat. X, cubequat. Y, cubequat. z );