OGRE game engine mouse selection object demo

xiaoxiao2021-03-06  28

OGRE game engine mouse selection object demo

Korea (drinking water is not angry)

http://www.hjpdiy.comhttp: //hjblog.blogchina.com

Disclaimer: This demonstration is just a role of throwing brick, please keep this article integrity, please keep the author information.

Since OGRe launched the latest release version, in order to adapt to the version, it is delayed for a few days, but the problem is solved, mainly (GUI).

OGRE is an open source graphic rendering engine to see http://www.ogre3d.org, the engine is famous, and there are many related information on the Internet.

In the university, this demo program demonstrates the mouse to select objects in OGRE, and can also detect which surface of the mouse, which faces the object, the professional point is the "collision detection of rays and surface (triangular)."

note:

This program uses an ESC key to exit.

The demo program is VC7.1 (2003) project, requiring the latest OGRE 1.0.0 Release support.

Directory settings before compilation: (Note The following directory is my machine directory, please set it to your own directory)

Include file directory (include)

D: / ogrerc1 / grenew / dependencies / include / D: / OGRERC1 / OGRENEW / DepENDENCIES / INCLUDE / CEGUID: / OGRERC1 / OGRENEW / OGREMAIN / INCLUDE

Library file settings (lib)

D: / Ogrerc1 / Ogrenew / Ogremain / lib / debugd: / ogrerc1 / grenew / dependencies / lib / debug

Key function

GetClickAT function: This function is mainly to call the RAY detection of OGRE to determine which object is selected, which can be used to determine the object selected in the mouse in multiple objects.

PickTest function: This function is used to determine whether the mouse is selected (calling the getClickat function), and select which item in the object. "

HJSDK Namespace: I am using the collision detection engine written by ogreode to check the collision surface.

Code download (if you can't run properly, please copy the executable to / OGRENEW / SAMPLES / COMMON / BIN / DEBUG / below)

Http://www.hjpdiy.com/docdoc/ogrepicktest.ra Note that this file has been corrected for (OGRE 1.0.0 Final Feb 23, 2005 - 03:44 PM By Sinbad).

Possible issues: Mesh with skeletal animation may not be recognized.

In fact, I wanted to write a simple "3D Rubi Cube" and then released it. Now I suddenly want to learn CG animation (Maya), so I will send this thing first, and I laugh.

转载请注明原文地址:https://www.9cbs.com/read-40642.html

New Post(0)