Introduction to scene scenarios for reading ogitor from ogre

Source: Internet
Author: User

In the past few days, when I used ogre to read the ogitor, I encountered many problems and could not find detailed instructions on the Internet. Although the scenario of reading the ogitor is too simple for many people, however, it is a little difficult for some new users. At the beginning, I thought it was impossible to start. Therefore, I would like to briefly describe the reading process and some common problems and hope to help some new users, the master can skip O (∩ _ ∩) O ~

I simply divided into two major steps:

1.Easy to useOgitor,Create your own scenario and export itSceneScenario File

I will not elaborate on the simple operations of ogitor. I will directly reference the following online operations:

I. Basic Control
1.Coordinates in the scenario: the X axis and the Z axis indicate left and right, and y indicates up and down.
2.Qweasd: Camera direction and walking control (in "fly" and "walk" modes, the function is slightly different)
3.Middle mouse + move: Shake Camera Lens
4.Right-click and move: rotate the camera lens
5.Alt + mouse wheel: close to or away from the selected object
6.Alt + right-click + move: the camera rotates around the selected object
7.Before placing the camera in the scene tree selected object: double-click the object name in the scene tree or press the "f" Key (only the scenario is effective in "fly" Mode)
8.Increase camera movement speed: "Speed +" in the scene toolbar (the icon is a camera with a plus sign)
9.Slow down camera movement speed: "Speed-" in the scene toolbar (the icon is a camera with a minus sign)

10.Left mouse button + move: Select multiple models
11.Select multiple models: press shift and then click the models to be selected.
12.Remove a model from multiple selections: press Ctrl and click the unnecessary model in sequence-opposite to the shift multiple choice function
13.Copy model: Shift + move a model
14.Move the model to another model or above the surface: Ctrl + move the model (not very sensitive, better than manual)
15.End key: an axis of the highlighted model (moving, rotating, and shrinking) control.

2.Create a scenario:

1.Open the Project Settings dialog box, for example, select the storage location of the project and enter the name of the project. On the assets option page, right-click the model and select the storage location of the mesh, material, and texture of the model (add your own model and other resources here, or re-set the project after the project is created)

 

 

2.After the creation, you can see an empty scene in the editor. In this case, you can add the basic object-terrain, sky, water body, and so on to the scene. The editor provides, on the objects panel, drag the required objects to the scene.

Terrain group: a terrain group. It is dragged to a scene (in this case, no terrain is generated, but a group of terrain is provided. The best unit of terrain in ogitor is page, the terrain group consists of many pages)

Caelum: sky box

Hydrax: water body

After you drag an object into the scene, you can view the name of each object in the scene tree. Click an object to edit its attributes on the property panel.

 

 


3. Add a terrain page
In the scene panel tree, right-click terrain group and select add page. In the displayed dialog box, select the page location and basic surface texture settings. After confirming, you can see the page you just added in the scene panel tree. You can also see the basic terrain in the scenario.


Page location: the coordinates of the page name and its location in the scenario are as follows:

 

 

Each time a page is added, two files, one. ogt file and one. TGA file, are added to the terrain folder under the project folder. A page corresponds to these two files. The relationship between the coordinate names of pages and the two names is as follows:
Page_effecffff.ogt is generated by the Page0x-1. One. the first four characters (0000) of the ogt file correspond to the first coordinate of the page name (0); the last four characters (FFFF) of the ogt File) corresponds to the Second coordinate of the page name (-1 here ).
0 0000
1 0001
Positive numbers are like above, and so on
-1 FFFF
-2 fffe
Other negative values are being collected.

3.Edit terrain
Shift + terrain increase: lower terrain
The terrain editing tool can adjust the style, size, and intensity of the brush.

Splat: Surface Texture
Shift + surface texture: erase this surface texture

A page supports a maximum of six different surface textures. When you find that the surface textures cannot be flushed to the terrain, there are two situations:
1. There are also 6 kinds of Terrain Maps for this page (you can see in the Property of this page whether layers has reached 6)
2. the brush texture is already in the current place of the brush, but it only covers another layer of different textures (for example, layer0 texture A and layer1 texture B exist in the same place of a page, if the texture on the brush is a at this time and A is used to brush this place, it does not respond. The correct method is to adjust the texture on the brush to B and hold down the Shift key, erase texture B to expose texture)

Paint :( colormap)
Color Texture is used. This function is disabled by default. To enable this function, select colour map in the properties of terrain group.

Splat grass: Add grass to the surface (do not use this function in the scene for the time being)

 

2.UseOgreRead the exportedSceneScenario File

Exported scenario file:


 

2.1Set ogitorCopy the built-in example code to your project

Set the directory relationship by yourself (add the header file containing the example file in the directory, or do not add it, as long as the example CPP file can find the corresponding header file, add ogreterrain_d.lib to the additional dependencies (based on the actual situation), and then compile the code. During the compilation process, the XX header file may not be found, and you can add it as needed, the res folder must also be copied.

The bool baseapplication: setup (void) method of the baseapplication. cpp file has a plug-in configuration to be read and changed to mroot = new ogre: Root ("plugins. cfg ") (If you can directly change the file in BIN to the same as him, you don't have to change it here)

2.2Put the exported file under your own resource path, and in resources. cfgAdd the corresponding path(Note: add it to [general]. Otherwise, the terrain cannot be read)

2.3 ogitorBINThe directory contains sampleappconfig. xml.Copy to your exeUnder the generated directory, change <sampleapp projectdir = "Media/scene/prj1" scene = "mscene. Scene"/> to your own

(Your EXE can be compiled here.Click "run" to see the scenario. If there are any issues left behind, I will try again !)


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.