Ogre usage tips

Source: Internet
Author: User

1. All user-objects to be attached to scenenode must be inherited from movableobject. For example, the most typical application is 3dsoundsource.

2. Related labels of renderqueue in ogre, the smaller the number, the first rendering.
Background-queue 0
Skybox-queue 20
World geometry-queue 30
Movableobjects-queue 50
Overlays-queue 100
For example, we need to display the particle effect on overlays,
We need to set the renderqueue of the particle object (which is a movableobject) to be greater than 100, such as 101.

3. The automatic retreat Technology of material script places multiple techique with different configuration levels in one material,
It can represent various configuration levels of ultrahigh high normal low. Techique is arranged from high configuration to low configuration in turn ,{
Sendmsg ('PW _ Ajax. php', 'Action = relatetag & tagname = og', this. ID)
} "> The ogre will be automatically detected in sequence. If the high configuration cannot be implemented, the next techique will be tested in sequence. when we implement all the above four techique schemes, we can configure them through the menu and use only one global scalar to mark the corresponding techiqueid. If we select ultrahigh, we choose id = 0 when using materials.

4. A vertex can be affected by a maximum of four bones.

5. Archive abstract class for file reading. If you want to read your own package, let's inherit it! And inherit a new archivefactory.

6. pluginfolder =./plugins indicates that the plug-in DLL is loaded under the Plugins directory.

7. Create your own log file
Logmanager * logmgr = new logmanager;
Log * log = logmanager: getsingleton (). createlog ("mylog. log", true, true, false );
8. Generate a screen at and only change the camera parameters.
Cam-> setaspectratio (real (1.77777); // 16 divided by 9
9. Use the parameters appended with createrenderwindow
Namevaluepairlist Params;
Params ["Left"] = "0 ";
Params ["TOP"] = 0;
Params ["title"] = "alternate window title ";
Opts ["parent?whandle"] = stringconverter: tostring (hwnd );
// Use an external window handle.
10. Wire box mode debugging
Camera-> setpolygonmode (pm_wireframe );
11. Let Camera track a node
Camera-> setautotracking (true, scenenode );
12. Produce stereoscopic glasses
Call the setfrustumoffset () and setfocallength () functions of camera.

13. picture-in-picture
Window-> addviewport (camera, zorder, X1, Y1, X2, Y2 );
You can add multiple sdks. The smaller the zorder, the lower the zorder.

14. When you need to attach a camera to scenenode, you 'd better disable "use fixed yaw axis". Otherwise, unexpected display will occur when scenenode rotates.

15. It is best to group resources during resource management, so that queries are faster and resources can be unloaded along with related groups.

16. The book says "ogre, by default, is not thread-safe ."

17. unmount resources that are not used by any object, use the following functions
Resourcegroupmanager: unloadunreferencedresourcesingroup ()
18. Clarify
Resourcegroupmanager: gesingleton (). clearresourcegroup ("Bootstrap ");
Resourcegroupmanager: gesingleton (). destroyresourcegroup ("Bootstrap ");
Difference
Clear reduces the reference count of objects in the Group by one, while destroy does not only clear but also delete the group.

19. If you want to make a loading progress bar, let's register a resourcegrouplistener to call its loading information back and forth.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.