Lastest Articles

Hiển thị các bài đăng có nhãn Đồ hoạ máy tính. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Đồ hoạ máy tính. Hiển thị tất cả bài đăng

Thứ Tư, 27 tháng 7, 2016

Game RPG là gì?

0 nhận xét
Game hành động nhập vai RPG đã quá quen thuộc với nhiều người. Bài viết ngày hôm nay sẽ cho game thủ một cái nhìn tổng quát nhất về thể loại này.

Những yếu tố cấu thành nên dòng RPG
Game RPG là từ viết tắt của trong tiếng anh của Role-Playing game, được gọi một cách thân thuộc là game nhập vai. Đây là một thể loại game mà người chơi sẽ hóa thân vào một nhân vật trong thế giới ảo, có khả năng nâng cấp bản thân và chịu trách nhiệm cho hành động cũng như hướng phát triển của chính nhân vật đó.

Trước khi đi vào câu trả lời game nhập vai RPG là gì, chúng ta sẽ cùng đi tới những khái niệm các yếu tố cấu thành nên dòng game RPG.

Cốt truyện
Một tựa game RPG hay không thể thiếu được một cốt truyện cuốn hút, có chiều sâu. Chắc chắn không phải game nào cũng có cốt truyện tuyệt vời. Nhưng nếu cốt truyện không có chiều sâu thì chúng ta không thể gọi game đó là game nhập vai được. Tính chất, sự cuốn hút người chơi ẩn sâu trong câu chuyện mà các trò chơi nhập vai mang lại.

Sự lựa chọn
Một cốt truyện hay là phải để người chơi tự cảm nhận lấy nó. Không phải là theo hướng các nhà phát triển bắt game thủ đi theo mà là để họ tự quyết định cuộc chơi của mình. Đây là một yếu tố quan trọng vì nếu thiếu đi những sự lựa chọn từ chính người chơi, sẽ còn gọi gì là một tựa game nhập vai nữa. Dòng game RPG đưa ra những gợi ý cho người chơi tự mình định hình thế giới trong game theo một cách rất riêng.

Một vai trò trong game
Đã là một game nhập vai thì chắc chắn nhân vật của bạn phải có một vai trò rõ ràng nào đó trong game. Bạn sẽ tự mình lựa chọn vai trò của mình trong trò chơi, quyết định tới diện mạo, sức mạnh tính cách hay thậm chí là tên của họ. Điều này được thể hiện thông qua các chỉ số nhân vật, cốt truyện và các lựa chọn.

Hệ thống chiến đấu
Đây là yếu tố khiến bạn tốn nhiều thời gian nhất vào một tựa game RPG. Một tựa game nhập vai phải có một hệ thống chiến đấu hoàn chỉnh, Đây cũng chính là sự khác biệt lớn nhất giữa các game nhập vai phương Đông và phương Tây. Các trò chơi RPG Nhật Bản thường đi theo lối đánh theo lượt, còn các tựa game phương Tây thì chú trọng vào chiến đấu thời gian thực.

Nhân vật
Không phải vai trò mà là kĩ năng và phát triển nhân vật. Đây là một trong những yếu tố thú vị và lôi cuốn nhất đối với người chơi, góp phần giữ chân họ lại với game. Hệ thống xây dựng chỉ số và phát triển nhân vật xuất hiện dưới nhiều dạng và phong cách khác nhau. Một dạng là thông qua các “level” – cấp bậc – trong đó bạn phải kiếm điểm kinh nghiệm và lên cấp để có thêm những điểm sức mạnh, phòng thủ… Bạn cũng có thể bỏ qua việc xây dựng chỉ số và tập trung vào xây dựng nhân vật thông qua các lựa chọn.

Vậy game nhập vai là gì?
Game RPG là dòng game cho bạn trong vai một nhân vật có vai trò rõ ràng, được đặt trong một thế giới được xác định rõ. Tại nơi đó, bạn phải cải thiện chính nhân vật mạnh dần lên và cốt truyện của trò chơi sẽ hoàn toàn do game thủ làm chủ.

Lịch sử dòng game RPG
Nhập vai RPG có thể nói là một trong những dòng game lâu đời nhất. RPG bắt đầu những sản phẩm đầu tiên vào giữa những năm 1970 như Dungeon , pedit5 và DND. Vào năm 1980, tựa game đầu tiên được phát hành chính thức cho máy tính là Dungeon n Dragons. Đó là tựa game đầu tiên nên nó rất hạn chế nhiều yếu tố chính của một game nhập vai. Nhưng các sản phẩm được phát hành tiếp theo sau đó như  Telengard (1982) hoặc Sword of Fargoal đã dần khắc phục được những hạn chế.

Bắt đầu từ năm 1984, các tựa game RPG trên máy tính có những bước dần hoàn thiện mình. Những tựa game ra mắt trong thời kì này như 50 Mission Crush và Questron nhận được khá nhiều sự ủng hộ từ phía cộng đồng. Hầu hết những năm từ 1984 đến 1988, các game nhập vai đều đi theo thể loại đánh lượt. Nhưng Dungeon Master đã chọn con đường khác, đi theo lối đánh thời gian thực. Một bước chuyển mình lớn của game nhập vai.

Thêm một bước tiến lớn đã làm thay đổi gần như bộ mặt của ngành công nghiệp, đó là việc game RPG đặt chân lên hệ máy Console. Đó là vào năm 1982, tựa game Dragonstomper phát hành trên hệ máy Atari 2600. Một số trò chơi đã đặt nền móng cho thể loại nhập vai chiến thuật hay thời gian thực như Dungeon Master (1985) hệ máy NES và New Bokosuka Wars trên hệ máy X86000 Sharp.

Từ năm 1987, các hãng phát triển bắt đầu hướng đi mới của game nhập vai trên console. Họ bắt đầu tách hẳn một số sản phẩm của mình ra so với PC, trở thành những tựa game RPG độc quyền. Zelda II: The Adventure Link của Shigeru Miyamoto cho hệ máy Famicom Disk System là bước đi đầu tiên trên con đường độc quyền.

Vào những năm đầu 1990, RPG trên Console đã chiếm ưu thế vượt trội so với hệ máy PC. Khác biệt lớn nhất giữa 2 hệ máy chính là việc khắc họa nhân vật trong game. Các nhà phát triển trên hệ Console đã làm rất tốt điều này. Đến cuối năm 1990, một cuộc cách mạng lớn thực sự diễn ra khi cái tên Final Fantasy VII xuất hiện. Nó được coi là một trong những game có ảnh hưởng nhất mọi thời đại, sau đã trở thành tượng đài lớn trong dòng game nhập vai. Tuy nhiên, sau đó, các tựa game nhập vai tiếp theo đã thêm thắt yếu tố CGI, những đoạn phim xen lẫn gameplay. Cách làm này thực sự hiệu quả, đặc biệt là khi nền tảng 3D bắt đầu được khai thác.

Nhờ vậy mà ranh giới phân chia giữa RPG Console và PC dần được xóa bỏ.
more.

Thứ Hai, 4 tháng 7, 2016

Video Game Writing and the Sense of Story [Writing]

0 nhận xét

Hot on the heels of my post about player characters actually being dolls, I came across a video (via Rock Paper Shotgun) from Game Theory with Scott Steinberg in which he asked about interactive fiction and storytelling in games. Have a look:
Interactive Fiction: The Art of Video Game Storytelling
This is the marketing story of games and storytelling that developers have told for decades. It’s an aspirational story, but look beyond the highlights to the substance underneath and it doesn’t really stack up.
Many of the struggles that game writers face today have not changed since the early days. Inherent contradictions prevent game storytelling from becoming more than it is, and I’d argue that it has reached the limits of technique. In 30 years of gamemaking there have never been, and likely never will be, any good game stories.
And yet, budding game writers, do not lose hope. Your contribution is more important than ever. Allow me to paint a new picture of your future for you:

Dramaturgy (What Stories Are)

It all starts with the difference between linearity and interactivity. In order for game storytelling to theoretically function, the two need to seem to have some sort of relationship. The theory goes, therefore, that a story is a line of events that happen one after another, whereas a game is a tree, with many branches and choices. Pictorially it might look something like this:
linear vs interactive_thumb[2]
The implication is that the interactive story has the potential to be a much richer experience than the linear one, and that is a powerful idea. The problem is that the metaphor is inaccurate. A more accurate image is this:

eiffel_thumb[2]
While both linear and interactive stories could be said to be object based (as Chris Crawford believes with his Storytron project), what makes a story a story is not the bricks. It’s the arrangement of those bricks into a specific structure which conveys more than the sum of its parts.
Story, as screenwriter William Goldman said, is structure. The basic unit of that structure is the dramatic arc. Stories are usually told in a straightforward A-to-Z fashion, so the dramatic arc is commonly the same as the chronological series of events. In more sophisticated stories, however, we often see chronology that jump back and forth. And yet the structure of the dramatic arc is largely unchanged.
A tale like The Usual Suspects conforms to the dramatic arc just as much as a Sherlock Holmes story, and even an apparently-backwards story like Memento is still a dramatic arc moving forward. The arc provides a framework of plot into which character development, inevitability and the unfolding of the story can happen.
Some stories have more than one arc. A television series like The Shield has many characters engaged in their own arcs. Some are episode-length, others season-length, and arguably one or two last for the entire life of the show. The masterful aspect of storytelling on this scale is the way that arcs are weaved in and out from one another, connected and resolved in unison, and the structure magnifies impact.
The other essential aspect of an impactful story is the inevitable outcome. The audience is powerless, either turning the pages of a book or sitting quietly in a darkened room and watching events unfold on stage or screen. They have empathy for the characters, and want to see to them succeed, but at the same time there is nothing that the audience can do to prevent their fate. This restriction is essential. The audience gives itself to the storyteller, and in exchange he gives them something arresting and impactful with which they can empathise, but not control.

Storysensing Beats Storytelling

It’s essential that control is in the hands of the player. Play is taking action, overcoming obstacles, creating, learning and other activities. In video games it operates via remote control of on-screen dolls, allows us to project into a world and discover it. But it also brings the player’s personality along with it.
Where in a dramatic arc the viewer is watching and empathising with the on-screen heroes and villains, in a game the player does not become that hero. A hero needs context, to be as much a part of the story as the story is a challenge for him to overcome, but players bring their own context. Controlling a doll is like driving a car in that it is simply an extension of the player through a controller, not an actor taking on a role.
Lacking the tools to create an arc, or a central hero to hang that arc from, the game story always ends up as something crude. It lacks pace, any sense of subtlety, needs to take control away from the player to turn his doll into a character for cut-scenes, and ends up trying to telegraph emotions at the player in order to make him feel.
Where story-like elements work really well in games, however, is when they focus on delivering a sense of a story rather than actually telling one. Games like Mass Effect, Max Payne, Grand Theft Auto, Final Fantasy, God of War, Uncharted 2 and so on create a sense of a world in motion. While the doll is at the player’s command, the rest of the world most certainly is not, and in setting challenges for the player to overcome and actions that they can extend, what comes across is the sensation of participation.
Storysensing is not storytelling. In a dramatic arc, the structure, pace and timing matter a great deal for delivering impact, but storysensing is better when focused on enhancing the portrait of the game world. Unlike storytelling, storysensing does not need to be dramatic. It can afford to be loose around the edges as long as those edges are not too apparent to the point that the player is seeing the frame.
Left 4 Dead creates a zombie-infested world and places guns in the player’s hand. Through a combination of co-operative dependent loops, and a game dynamic that deliberately paces out the encounters and objects, the game conveys a world in motion. Add a layer of snappy character dialogue and numina such as posters on walls and other touches, and Left 4 Dead draws the player into its world so completely that he wants to play it again and again.
Storysensing is best when deft rather than deep. Roleplaying and adventure games have tried for decades to use mechanisms like branching dialogue to storytell to the player, but in practise these mechanisms are heavy handed. Mass Effect in particular is an example of a game whose rush to storytell is so replete with redundant detail and branched dialogue that it just becomes tedious. It actively works against the sense of story because it reminds players too often that they are watching a mechanical game system simply go through motions.

What Game Writing Does Well

Writing for games is completely different from writing for stories. Its function is not to drive a narrative forward, but to support the sense of story. Language contributes to whether a game transcends the screen and engages with players on a more human level. But a game writer is not a storyteller. He’s a painter.
Writing serves three functions in games:
1. Establishing character
A game character is a potent weapon in the portraiture of a world. Through the use of characters like Roman, Brucie and many others Liberty City feels more like a world in motion than a bunch of city geometry and cop simulators. Each character is different, seems to add something momentarily funny or insightful to the portrait, and then passes out of view again.
Establishing character is not the same thing as character development. Character development in a dramatic arc is a long and complex process, but in a game it’s completely at odds with what a world needs to achieve. The art of establishing characters is conveying an impression of who they are in totality, because they are just a part of a portrait.
Poorly established or overly-developed characters are examples of bad game writing. Half Life 2 repeatedly insists on taking long pauses to hear what Alyx Vance has to say and feel, and those sections are simply awful. While the intention of the writing is to bring depth to the game, what actually happens is that the game forces the player to listen to what amounts to cheap exposition.
Many games make this mistake. Red Dead Redemption is a recent example of a game that gets so wrapped up in exposition on life in the Old West that it becomes dull. A game character needs to be established with a light touch, so that it’s the player’s choice to like or loathe at their own pace. Take that away, or foist exposition on the player, and intended feelings of sympathy quickly turn to antipathy or boredom.
The other mistake that bad game writing makes is in trying to establish the player’s doll. While it can work to turn the doll into a character temporarily (especially at the start of the game), it doesn’t really work when the player is actually controlling the doll. God of War manages to establish Kratos using a few arresting cut scenes, and the Max Payne games use comic sequences to establish Max. After that, establishment is pushed to one side. Compare this to Halo 3 where the game stops player for ham-fisted brain-woozing moments from Cortana, and the difference is clear.
The worst examples of establishment are when games talk at the player and try to make him feel. Whether trapped in a room with a game character talking to camera, a belaboured cut-scene sequence, or pointless segments of enforced branched dialogue, talking at the player to induce him to feel is just bad writing.
2. Contributing to Numina
The Cake is a Lie.
This graffiti in Portal immediately confirms the player’s suspicion that GlaDOS is not to be trusted. Five simple words, on the periphery of the game for the player to notice or not, and suddenly the game has shifted gear.
In Max Payne 2, the player discovers a voicemail machine, activates it and hears the sound of Max’s own voice talking to a phone-sex line just because he’s lonely. In Deus Ex, while running around in the sewers on a mission, there are several homeless people that have caught the plague and each has a vignette to impart that adds colour to the scene.
These are examples of language-led numina. Advertisers know that little segments of words, snippets and slogans can manage to capture whole emotions immediately. In a sense the writing of numina is the same. Words are an active part of painting out the canvass, but the reason why they work is that they are player-driven.
Discovering numina is a reward in and of itself because it shows that there is more to the game than just actions. They make the world feel alive and establish a voice for the game. Voice appeals to the artistic, non-rational part of the mind and gives a sense of humanity and creation behind the game.
3. Task Assignment (Shuffling the Deck)
An important part of establishing game dynamics, and setting up new and interesting tasks, is to establish that the game world changes. It is in motion rather than just being one static thing, and (like a game of cards, hence the shuffling metaphor) this means that the different elements, characters and challenges in play will change.
Game writing often has a role in setting up missions and changing levels. It can function partially as reward, or simply instructional text. Most commonly this activity actually happens between segments because that is the simplest to implement. However it can also work within segments if handled right. Handled wrong and it can lead to things like annoying buddy sections in the game where the player has to tail around after a character.
Alternatively game writing can take too long to get to task assignment, or it can make the mistake of making the task unclear. Point and click adventures were frequently maddening for being too cryptic, for example, so that the game writing was usually more of a hindrance than a help.

The Delivery of Writing

Writing in games is not all cinematic cut scenes. In many cases, it is seemingly incidental items, but each are still writing nonetheless. They all add to the sense of story. Here are some of the most common ways that writing is delivered:
1. The Cut Scene
Used for trailers and big moments in games, cut scenes are best used infrequently and only for short powerful punches. The best cut scenes are visually arresting, interesting and snappy. Some games go to town with cut-scenes, and they really are some of the worst game writing that you will ever encounter.
Other games keep them short, but use far too many. Roleplaying games commonly place the doll into character mode for every single interaction with another another. Endless snips of dialogue and branched conversations issue forth, so many so that they become expositional and repetitive. Wooden acting by procedurally animated characters in these kinds of scenes does nothing to induce story sense.
2. Scrolls
A scroll is an artistic reward of game text that you can find in the world which adds back-story. A simple example is in World of Goo, where the world is populated with signs that you can click on. Open them up, and a panel displays some funny text about the level or the game world.
Scrolls are fun, but they need to be paced appropriately. A scroll found in the middle of a fire fight has no time to be funny, while a long and rambling scroll containing no character or insight is just a missed opportunity.
3. User Interface
Visually and linguistically, interfaces add to the subtle awareness of a game world. A famous example of this is the user interface in Starcraft, in which the choice of playing race also changes the interface colours and voices. As you select troops, issue orders and otherwise interact with the game, this subtle reinforcement continues throughout.
User interface can also be more elaborate. Mass Effect maintains a whole library of game information which details all of the races, technologies and history of the galaxy in its user interface. It all creates a tapestry that the player can explore at her leisure and is entirely writing-driven.
4. Alongside Dialogue
Uncharted 2 makes heavy use of alongside dialogue. As Nathan Drake and his friends negotiate the game levels, they have snappy one liners, observations and even just simple alerts like ‘Watch out’.
Alongside dialogue works best when the player doesn’t really have to pay attention to it. Red Dead Redemption make the mistake of tying a lot of character exposition into horse-riding sequences, making them both hard to hear and distracting. Other games make the mistake of having alongside dialogue become repetitive. Fable frequently featured the voice of the player’s sagely mentor advising him to attack in certain ways to increase combat multipliers. Once or twice this is fine, but hearing it 100 times over the course of the whole game is intensely annoying.
5. Incidentals
Finally, incidentals are elements like radio stations, televisions in the background or passer-by characters making a quick remark about the state of the doll’s clothes. Incidentals activate as the player walks around the world without any action from the player himself. They are completely unconnected to anything that the player has to do, don’t need to be discovered, and just randomly happen.
As with alongside dialogue, they can add a lot of colour to a game but also risk invoking antipathy if they are repetitive. Incidentals should also avoid being used for gameplay-relevant information because the player may not notice them.

Conclusion

After 30 years of trying, with hundreds of books and white papers having been written on the subject, and the same marketing story saying the same thing about getting better at storytelling continuing to do the same rounds, I think it’s fair to say that games as a storytelling medium doesn’t really hang together.
Considered as a world in motion, like a painting with a sense of story but with a deliberately light touch, yields a better framework for understanding. It is not the case that writing has no place in games. Very far from it in fact, but its place is a portrait-filling rather than a storytelling one.
Videogames are not, in turns out, a storytelling art. They have tried very hard to be, and their reasons for trying are noble, but the results are always ham-fisted. There are no good game stories because game stories don’t really matter. What matters is the game world, in all of its glorious detail.
In writing my book, I mean to break you out of your old mode of thinking that games and stories must converge, because I think that’s a fight that you will always lose. When we learn to describe our own art in our own way and realise what actually does work, then we will finally move forward.
more.

Chủ Nhật, 5 tháng 7, 2015

Ogre3D: Tutorial 6- SceneManager, SceneNode, và các đối tượng thực thể

0 nhận xét
(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Ở bài hướng dẫn này tôi sẽ hướng dẫn bạn về cấu trúc cơ bản của một ứng dụng Ogre bao gồm  SceneManager, SceneNode, và các đối tượng thực thể [Entity].

I:  Chuẩn bị
Tạo ứng dụng mẫu như tôi đã hướng dẫn ở bài trước Tutorial 4 - Tạo một ứng dụng đơn giản với Visual Studio 2010.
Hình 6.1: Ứng dụng cơ bản
Hình 6.7: Kết quả cuối cùng
XI: Source code đầy đủ của Tutorial 6
 >>>Filename   : OgreApp2.cpp

 XII: Bài tiếp theo
>>> Ogre3D: Tutorial 7
more.

Ogre3D: Tutorial 5- Cách tạo resource từ [AutoDesk Maya 2014 + Maya Exporters]

1 nhận xét
(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Ở bài hướng dẫn này tôi sẽ hướng dẫn bạn sử dụng [AutoDesk Maya 2014 + Maya Exporters] để tạo file resource đưa vào ứng dụng Ogre3D.

Bước 1: Download và cài đặt [AutoDesk Maya 2014 + Maya Exporters]
>>> Download Autodesk Maya 2014
Link File.SvIT:
Part 1: http://file.sinhvienit.net/28ea101b
Part 2: http://file.sinhvienit.net/28871013

Link Fshare.vn:
http://www.fshare.vn/file/TD9C0THRBT

>>> Download Crack Autodesk Maya 2014
http://file.sinhvienit.net/b6f40dc3
hoặc
http://www.fshare.vn/file/T90QGQG4GT

>>> Download Maya Exporters + hướng dẫn crack AutoDesk Maya 2014
Link Google Drive:
https://drive.google.com/file/d/0B2WZzt32mxKOdDhoVWxWY3E1V3c

>>> Download  file Dragon: 
Link tf3dm: http://static.tf3dm.com/models/s3/s54gp4l5b7-Dragon.zip
 
Bước 2: Sau khi cài đặt xong, ta tạo resource để đưa vào ứng dụng Ogre3D
Hình 5.1: Chọn import
Hình 5.2: Chọn file tương ứng mà Maya hỗ trợ hoặc bạn có thể tự vẽ miễn sao là có hình
Hình 5.3: Export
Hình 5.4: Tích vào định dạng bạn muốn export, trong trường hợp này tôi cần file .*mesh nên tôi sẽ chọn đường dẫn cho nó vào media/model.
Hình 5.5: Thành quả.
Bước 3: Tạo ứng dụng mẫu như tôi đã hướng dẫn ở bài trước Tutorial 4 - Tạo một ứng dụng đơn giản với Visual Studio 2010. Sau đó, sửa hàm OgreApp2::createScene(void) theo hướng dẫn sau:

//-------------------------------------------------------------------------------------
void OgreApp2::createScene(void)
{
    Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "dragon.mesh");/* Sửa file ogrehead thành file ta dragon.mesh ta vua tao ra*/

    Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    headNode->attachObject(ogreHead);

    // Set ambient light
    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
      
    // Create a light
    Ogre::Light* l = mSceneMgr->createLight("MainLight");
    l->setPosition(20,80,50);
 //-------------------------------------------------------------------------------------


Bước 4: Chạy ứng dụng. Chúc các bạn thành công!



more.

Thứ Sáu, 15 tháng 5, 2015

Đồ hoạ máy tính - Bài 2: Giới thiệu chung

0 nhận xét
(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Sau đây sẽ là những giới thiệu chung về môn Đồ hoạ máy tính.


I, Đồ hoạ máy tính là gì?
1, Khái niệm
Theo wikipedia, "Đồ họa máy tính là một lĩnh vực của khoa học máy tính nghiên cứu về cơ sở toán học, các thuật toán cũng như các kĩ thuật để cho phép tạo, hiển thị và điều khiển hình ảnh trên màn hình máy tính. Đồ họa máy tính có liên quan ít nhiều đến một số lĩnh vực như đại số, hình học giải tích, hình học họa hình, quang học,... và kĩ thuật máy tính, đặc biệt là chế tạo phần cứng (các loại màn hình, các thiết bị xuất, nhập, các vỉ mạch đồ họa...)."

Các khái niệm còn lại tham khảo bao gồm (Lịch sử (băt đầu 1960), Phần cứng và đồ họa, Các hệ màu thông dụng (RGB, CMYK, HSB, Lab), Giải thuật xây dựng các thực thể cơ sở, Các phép biến đổi Affine cơ sở trên mặt phẳng, Các ứng dụng của đồ họa máy tính)) tại đây: http://vi.wikipedia.org/wiki/%C4%90%E1%BB%93_h%E1%BB%8Da_m%C3%A1y_t%C3%ADnh


2,
more.

Thứ Năm, 22 tháng 1, 2015

Ogre3D: Tutorial 4 - Tạo một ứng dụng đơn giản với Visual Studio 2010

0 nhận xét
(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Ở bài hướng dẫn này chúng ta cùng tạo ứng dụng Ogre3D đầu tiên với Ogre_VC10_AppWizard_1.8.0.

Bước 1: Download và cài đặt Ogre SDK (OgreSDK_vc10_v1-9-0).
Những bài hướng dẫn sắp tới tôi sẽ sử dụng Visual Studio 2010 SP1 + Ogre_VC10_AppWizard_1.8.0 để đẩy nhanh quá trình tạo Project, nên bạn có thể cài thêm ứng dụng này tại đây.
Ngoài ra, nếu muốn sử dụng phiên bản khác bạn có thể tham khảo cách cấu hình cho Visual Studio tại đây.
Bước 2: Tạo Project với Ogre_VC10_AppWizard_1.8.0 ở chế độ Standard Application.

Tạo Project nhờ Ogre_VC10_AppWizard_1.8.0

Bước 3: Tinh chỉnh lại Project cho tương thích với OgreSDK_vc10_v1-9-0.
1, Vào Project Properties.


 2, Chọn Configuration Properties >> C/C++ >> General >> Additional Include Directories


Sau đó, thêm đường dẫn này "$(OGRE_HOME)\include\OGRE\Overlay" và ok. Tiếp đó, ta chuyển sang thiết lập "Active(Debug)".

Configuration Properties - Linker - Input - Additional Dependencies - Debug, thêm đoạn mã sau "OgreOverlay_d.lib" vào hàng tiếp theo và ok.


 Sau đó, chuyển từ chế độ "Active(Debug)" sang "Active(Release)", và làm tương tự so với Active(Debug), nhưng đoạn mã thêm vào đường dẫn Configuration Properties - Linker - Input - Additional Dependencies - Release là "OgreOverlay.lib", rồi ok 2 lần là xong.


Bước 4: Xóa 2 file BaseApplication.cpp và BaseApplication.h (TutorialFramework1.8-cần phải convert sang 1.9 hoặc 1.10), rồi thay thế bằng 2 file đã được tôi chỉnh sửa theo TutorialFramework 1.10, bạn có thể download tại đây >> TutorialFramework110ConvertByBahao247.zip .


Thêm BaseApplication.cpp vào thư mục src trong Project và BaseApplication.h vào thư mục include.

 Sau đó, Existing item 2 file trên trở lại Project và build...




build thành công...
Lưu ý:
Nếu gặp lỗi 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Thì sửa như sau:
  • Either disable incremental linking, by going to
    Project Properties 
       -> Configuration Properties 
           -> Linker (General) 
              -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
    
  • or install VS2010 SP1 sau đó khởi động lại VS2010 và tiếp tục build.



Bước 5: Chạy ứng dụng. Chúc các bạn thành công!








more.

Thứ Ba, 30 tháng 12, 2014

Ogre3D: Tutorial 3 - CMake Build Ogre bằng CMake

0 nhận xét

(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Ở bài hướng dẫn này tôi sẽ giới thiệu cách Build Ogre Project bằng công cụ CMake.

  1. Set OGRE_DEPENDENCIES_DIR to E:\TNA\OgreSDK\Dependencies\build\ogredeps như hình dưới. Sau đó, bấm configure lại 1 lần nữa. Image
  2. Download Dependencies repository(external link). Sau đó cài vào ổ OgreSDK của bạn. VD - E:\TNA\OgreSDK\Dependencies
  3. Download và cài đặt CMake(external link).
  4. Khởi chạy CMake.
  5. Nhập các ô như sau "Where is the source code" to E:\TNA\OgreSDK\Dependencies; và  "Where to build the binaries" pointing to "E:\TNA\OgreSDK\Dependencies\build"
  6. Click 'Configure' và chọn the generator (i.e. if you're using Visual Studio 2013, select Visual Studio 12).                                                 Image
  7. Chọn 'Ok' khi có hộp thoại hỏi bạn có muốn tạo build directory
  8. Thỉnh thoảng sẽ có các cảnh báo từ CMake. Nhưng bạn chỉ cần Ignore chúng.
  9. Và sau đó thì 'Generate'.
  10. Mở E:\TNA\OgreSDK\Dependencies\build\OGREDEPS.sln under Visual Studio.
  11. Build solution này; tạo ra thư viện FreeImage, freetype, OIS, zlib and zziplib. Ta build cả ở 2 chế độ Debug và Releas.
  12. Khi nó kết thúc, bạn click chuột phải vào INSTALL project, và click build. Image
  13. Bạn nên tạo SDK folder structure như đây E:\TNA\OgreSDK\Dependencies\build\ogredeps
  14. Bây giờ download Ogre từ repository(external link) into C:\OgreSDK.
  15. Open CMake, set E:\TNA\OgreSDK và E:\TNA\OgreSDK\build vào 2 ô "Where is the source code" và "Where to build the binaries".
  16. Bấm Configure và chọn version Visual Studio để tạo ra dependencies tương ứng.
  17. Pro tip: If "E:\TNA\OgreSDK\Dependencies" contains the files that are generated in E:\TNA\OgreSDK\Dependencies\build\ogredeps; you can skip the previous step.
  18. Click Generate.
  19. Mở solution tại đường dẫn E:\TNA\OgreSDK\build\OGRE.sln và compile.
  20. Chuột phải vào INSTALL project nếu bạn muốn tạo SDK.
  21. Hoàn tất..
  22. Nếu bạn làm giống tôi, bạn có thể thêm E:\TNA\OgreSDK\build\include vào thư mục  include và các thư viện C:\OgreSDK\build\lib\Debug (and Release), cũng như DLLs trong bin\debug (or release.
Nếu bạn còn thắc mắc có thể xem thêm video sau, Good lucks!:

more.

Ogre3D: Tutorial 2 - Ogre Wiki Tutorial Framework

0 nhận xét

(Bahao247) - Chào mừng bạn đã đến với Blog của tôi. Ở bài hướng dẫn này chúng ta sẽ tìm hiểu về Ogre3D Framework. 

Quick Download

Dành cho Ogre 1.9 ("Ghadamon")
 Ogre Wiki Tutorial Framework 1.9 - (Windows line endings)
 Ogre Wiki Tutorial Framework 1.9 - (Unix line endings)

Dành Ogre 1.10 ("Xalafu")
 Ogre Wiki Tutorial Framework 1.10 - (Windows line endings)
 Ogre Wiki Tutorial Framework 1.10 - (Unix line endings)



Giới thiệu

Đây là những bước cơ bản để tạo nên một Ogre Wiki Tutorial Framework, chúng ta cùng bắt đầu nhé!

Motivation

Bạn có thể sử dụng các framework chuẩn được cung cấp ở trên hoặc sử dụng Ogre AppWizard (mới có bản Ogre AppWizard 1.8 dành cho VS 2010 và Code::Blocks) và build projects của bạn bằng CMake.

Tổng quát

Framework bao gồm 2 classes: BaseApplication and TutorialApplication.
BaseApplication có chức năng tạo ra hàm createScene() để lớp ứng dụng sử dụng. Nó chỉ là lớp cơ sở và không thể khởi tạo riêng biệt.
TutorialApplication có nguồn gốc từ lớp BaseApplication, và implement những function của createScene().

Cơ chế hoạt động

BaseApplication hoạt động như năm giác quan trong một lớp:
class BaseApplication : public Ogre::FrameListener, public Ogre::WindowEventListener, public OIS::KeyListener, public OIS::MouseListener, OgreBites::SdkTrayListener
  1. Các ứng dụng được tạo từ FrameListener, bao gồm các hàm: frameStarted(), frameRenderingQueued()frameEnded(). Xem thêm tại Basic Tutorial 4.
  2. WindowEventListener là khu vực làm việc của ứng dụng, nó bắt mọi sự kiện  di chuyển / thay đổi kích cỡ và đóng cửa sổ.
  3. OIS library được sử dụng để xử lý đầu vào, bắt sự kiện chính và sự kiện chuột bằng hàm tiếp nhận OIS (KeyListener và MouseListener).
  4. Ngoài ra, còn OgreBites dùng cho GUI widgetscamera handling, GUI.

Vòng đời của 1 ứng dụng

  1. Một Ogre::Root mới được tạo ra.
  2. Đường dẫn tới các tài nguyên (Resource) được đọc từ một tập tin cấu hình (resources_d.cfg).
  3. Cửa sổ cấu hình ứng dụng hiện lên cho phép bạn lựa chọn các thông số và độ phân giải, vv...
  4. Cảnh được được tạo ra.
  5. Camera được tạo ra và thiết lập.
  6. The OgreBites dùng để điều khiển camera được kết nối với các camera.
  7. Một khung nhìn được tạo ra và thiết lập.
  8. Tất cả các nhóm tài nguyên được khởi tạo.
  9. Cảnh được tạo ra.
  10. OIS được khởi tạo và thiết lập.
  11. Ứng dụng tự động bắt các sự kiện chuột và bàn phím.
  12. Ứng dụng tự động bắt các sự kiện từ cửa sổ như đóng hoặc resized.
  13. OgreBites SDKTrays được thiết lập.
  14. Ứng dụng tự động bắt các sự kiện.
  15. Vòn lặp render sẽ được bắt đầu và tiếp tục chạy đến khi thoát ứng dụng.

Walkthrough

MinimalOgre

Cùng bắt đầu với 'MinimalOgre':
MinimalOgre-h
MinimalOgre-cpp
Nó giống với Tutorial Framework Ogre Wiki, nhưng nó chỉ có một lớp là go().
//-----------------------------------------------------------------------------------------------------------------------
bool MinimalOgre::go(void)
{
#ifdef _DEBUG
    mResourcesCfg = "resources_d.cfg";//tập tin chứa đường dẫn tài nguyên
    mPluginsCfg = "plugins_d.cfg";//tập tin cấu hình chứa đường dẫn các plugins
#else
    mResourcesCfg = "resources.cfg";//debug ở chế độ release sẽ dùng 2 tập này
    mPluginsCfg = "plugins.cfg";
#endif
 
    // construct Ogre::Root
    mRoot = new Ogre::Root(mPluginsCfg);//Khởi tạo gốc Root
 
//-------------------------------------------------------------------------------------
    // setup resources
    // Load resource paths from config file
    Ogre::ConfigFile cf;//Load tài nguyên
    cf.load(mResourcesCfg);
 
    // Go through all sections & settings in the file
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
 //Quét qua tất cả các phần và các thiết lập trong tập tin gồm 3 thông số là archName, typeName, secName: VD: "Popular", "FileSystem", "Media/fonts"
//secName là tên của từng phần: khái quát, phổ biến, chung
//typeName là loại tài nguyên được xác định: hệ thống tập tin (thư mục) hoặc //file Zip
//archName là một đường dẫn tuyệt đối đến tài nguyên
    Ogre::String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }
//-------------------------------------------------------------------------------------
    // configure
    // Show the configuration dialog and initialise the system
    // You can skip this and use root.restoreConfig() to load configuration
    // settings if you were sure there are valid ones saved in ogre.cfg
    if(mRoot->restoreConfig() || mRoot->showConfigDialog())
    {
        // If returned true, user clicked OK so initialise
        // Here we choose to let the system create a default rendering window by passing 'true'
        mWindow = mRoot->initialise(true, "MinimalOgre Render Window"); 
//Khởi tạo cửa sổ ứng dụng, tham số thứ 2 là title của cửa sổ
 }
    else
    {
        return false;
    }
//-------------------------------------------------------------------------------//------thiết lập cảnh gắn vào Root----
    // choose scenemanager
    // Get the SceneManager, in this case a generic one
    mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
//-------------------------------------------------------------------------------//------Khởi tạo Overlay---
 // initialize the OverlaySystem (changed for 1.9)
 mOverlaySystem = new Ogre::OverlaySystem();
    mSceneMgr->addRenderQueueListener(mOverlaySystem);
//-------------------------------------------------------------------------------//------Tạo camera và cấu hình các thông số----
    // create camera
    // Create the camera
    mCamera = mSceneMgr->createCamera("PlayerCam");//tên Camera
 
    // Position it at 500 in Z direction
    mCamera->setPosition(Ogre::Vector3(0,0,80));//Vị trí
    // Look back along -Z
    mCamera->lookAt(Ogre::Vector3(0,0,-300));//tầm nhìn
    mCamera->setNearClipDistance(5);//khoảng dịch chuyển
 
    mCameraMan = new OgreBites::SdkCameraMan(mCamera);   // create a default camera controller
//-------------------------------------------------------------------------------------
    // create viewports
    // Create one viewport, entire window
    Ogre::Viewport* vp = mWindow->addViewport(mCamera);//Tạo khung nhìn đầu tiên
    vp->setBackgroundColour(Ogre::ColourValue(0,0,0));//nền màu đen
 
    // Alter the camera aspect ratio to match the viewport
    mCamera->setAspectRatio(
        Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
//-------------------------------------------------------------------------------------
    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
//-------------------------------------------------------------------------------------
    // Create any resource listeners (for loading screens)
    //createResourceListener();
//-------------------------------------------------------------------------------------
    // load resources
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
//-------------------------------------------------------------------------------------
    // Create the scene
    Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
 
    Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    headNode->attachObject(ogreHead);
 
    // Set ambient light
    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
 
    // Create a light
    Ogre::Light* l = mSceneMgr->createLight("MainLight");
    l->setPosition(20,80,50);
//-------------------------------------------------------------------------------------
    //create FrameListener
    Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
    OIS::ParamList pl;
    size_t windowHnd = 0;
    std::ostringstream windowHndStr;
 
    mWindow->getCustomAttribute("WINDOW", &windowHnd);
    windowHndStr << windowHnd;
    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
 
    mInputManager = OIS::InputManager::createInputSystem( pl );
 
    mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
    mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
 
    mMouse->setEventCallback(this);
    mKeyboard->setEventCallback(this);
 
    //Set initial mouse clipping size
    windowResized(mWindow);
 
    //Register as a Window listener
    Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
 
    mInputContext.mKeyboard = mKeyboard;
    mInputContext.mMouse = mMouse;
    mTrayMgr = new OgreBites::SdkTrayManager("InterfaceName", mWindow, mInputContext, this);
    mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT);
    mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT);
    mTrayMgr->hideCursor();
 
    // create a params panel for displaying sample details
    Ogre::StringVector items;
    items.push_back("cam.pX");
    items.push_back("cam.pY");
    items.push_back("cam.pZ");
    items.push_back("");
    items.push_back("cam.oW");
    items.push_back("cam.oX");
    items.push_back("cam.oY");
    items.push_back("cam.oZ");
    items.push_back("");
    items.push_back("Filtering");
    items.push_back("Poly Mode");
 
    mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items);
    mDetailsPanel->setParamValue(9, "Bilinear");
    mDetailsPanel->setParamValue(10, "Solid");
    mDetailsPanel->hide();
 
    mRoot->addFrameListener(this);
//-------------------------------------------------------------------------------------
    mRoot->startRendering();
 
    return true;
}
//-------------------------------------------------------------------------------

TinyOgre

TinyOgre-h
TinyOgre-cpp
Tiny Ogre không kế thừa bất cứ thứ gì và .
Nó chỉ sử dụng OIS để lấy đầu vào và bắt sự kiện:

//-------------------------------------------------------------------------------
 
bool TinyOgre::go(void)
{
#ifdef _DEBUG
    mResourcesCfg = "resources_d.cfg";
    mPluginsCfg = "plugins_d.cfg";
#else
    mResourcesCfg = "resources.cfg";
    mPluginsCfg = "plugins.cfg";
#endif
 
    // construct Ogre::Root
    mRoot = new Ogre::Root(mPluginsCfg);
 
//-------------------------------------------------------------------------------------
    // set up resources
    // Load resource paths from config file
    Ogre::ConfigFile cf;
    cf.load(mResourcesCfg);
 
    // Go through all sections & settings in the file
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
 
    Ogre::String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }
//-------------------------------------------------------------------------------------
    // configure
    // Show the configuration dialog and initialise the system
    // You can skip this and use root.restoreConfig() to load configuration
    // settings if you were sure there are valid ones saved in ogre.cfg
    if(mRoot->restoreConfig() || mRoot->showConfigDialog())
    {
        // If returned true, user clicked OK so initialise
        // Here we choose to let the system create a default rendering window by passing 'true'
        mWindow = mRoot->initialise(true, "TinyOgre Render Window");
    }
    else
    {
        return false;
    }
//-------------------------------------------------------------------------------------
    // choose scenemanager
    // Get the SceneManager, in this case a generic one
    mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
//-------------------------------------------------------------------------------------
    // create camera
    // Create the camera
    mCamera = mSceneMgr->createCamera("PlayerCam");
 
    // Position it at 500 in Z direction
    mCamera->setPosition(Ogre::Vector3(0,0,80));
    // Look back along -Z
    mCamera->lookAt(Ogre::Vector3(0,0,-300));
    mCamera->setNearClipDistance(5);
 
//-------------------------------------------------------------------------------------
    // create viewports
    // Create one viewport, entire window
    Ogre::Viewport* vp = mWindow->addViewport(mCamera);
    vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
 
    // Alter the camera aspect ratio to match the viewport
    mCamera->setAspectRatio(
        Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
//-------------------------------------------------------------------------------------
    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
//-------------------------------------------------------------------------------------
    // Create any resource listeners (for loading screens)
    //createResourceListener();
//-------------------------------------------------------------------------------------
    // load resources
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
//-------------------------------------------------------------------------------------
    // Create the scene
    Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
 
    Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    headNode->attachObject(ogreHead);
 
    // Set ambient light
    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
 
    // Create a light
    Ogre::Light* l = mSceneMgr->createLight("MainLight");
    l->setPosition(20,80,50);
//-------------------------------------------------------------------------------------
 
    while(true)
    {
        // Pump window messages for nice behaviour
        Ogre::WindowEventUtilities::messagePump();
 
        if(mWindow->isClosed())
        {
            return false;
        }
 
        // Render a frame
        if(!mRoot->renderOneFrame()) return false;
    }
 
    // We should never be able to reach this corner
    // but return true to calm down our compiler
    return true;
}

//-------------------------------------------------------------------------------

LowLevelOgre

LowLevelOgre-h
LowLevelOgre-cpp

Cài đặt

//-------------------------------------------------------------------------------
 
// construct Ogre::Root : no plugins filename, no config filename, using a custom log filename
mRoot = new Ogre::Root("", "", "LowLevelOgre.log");
 
// A list of required plugins
Ogre::StringVector required_plugins;
required_plugins.push_back("GL RenderSystem");
required_plugins.push_back("Octree & Terrain Scene Manager");
 
// List of plugins to load
Ogre::StringVector plugins_toLoad;
plugins_toLoad.push_back("RenderSystem_GL");
plugins_toLoad.push_back("Plugin_OctreeSceneManager");
 
// Load the OpenGL RenderSystem and the Octree SceneManager plugins
for (Ogre::StringVector::iterator j = plugins_toLoad.begin(); j != plugins_toLoad.end(); j++)
{
#ifdef _DEBUG
    mRoot->loadPlugin(*j + Ogre::String("_d"));
#else
    mRoot->loadPlugin(*j);
#endif;
}
 
// Check if the required plugins are installed and ready for use
// If not: exit the application
Ogre::Root::PluginInstanceList ip = mRoot->getInstalledPlugins();
for (Ogre::StringVector::iterator j = required_plugins.begin(); j != required_plugins.end(); j++)
{
    bool found = false;
    // try to find the required plugin in the current installed plugins
    for (Ogre::Root::PluginInstanceList::iterator k = ip.begin(); k != ip.end(); k++)
    {
        if ((*k)->getName() == *j)
        {
            found = true;
            break;
        }
    }
    if (!found)  // return false because a required plugin is not available
    {
        return false;
    }
}

//-------------------------------------------------------------------------------

Danh sách plugin names and render system names:
BSPSceneManager PluginName = "BSP Scene Manager"
OgreCgPlugin PluginName = "Cg Program Manager"
OgreOctreePlugin PluginName = "Octree & Terrain Scene Manager"
OctreeZone PluginName = "Octree Zone Factory"
OgreParticleFXPlugin PluginName = "ParticleFX"
PCZSceneManager PluginName = "Portal Connected Zone Scene Manager"
Direct3D10 PluginName = "D3D10 RenderSystem"
OgreD3D11Plugin PluginName = "D3D11 RenderSystem"
OgreD3D9Plugin PluginName = "D3D9 RenderSystem"
OgreGLPlugin PluginName = "GL RenderSystem"
OgreGLESPlugin PluginName = "OpenGL ES 1.x RenderSystem"

OgreD3D10RenderSystem Name = "Direct3D10 Rendering Subsystem"
Direct3D11 Name = "Direct3D11 Rendering Subsystem"
Direct3D9 Name = "Direct3D9 Rendering Subsystem"
GL Name = "OpenGL Rendering Subsystem"
GLES Name = "OpenGL ES 1.x Rendering Subsystem"
OgreOctreePlugin PluginName = "Octree Scene Manager"

Tài  nguyên

// setup resources
// Only add the minimally required resource locations to load up the Ogre head mesh
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/materials/programs", "FileSystem", "General");
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/materials/scripts", "FileSystem", "General");
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/materials/textures", "FileSystem", "General");
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/models", "FileSystem", "General");

Cấu hình

Chúng ta có thể sử dụng OpenGL Rendering Subsystem, với độ phân giải màn hình là 800x600 với vsync tắt:
// configure
// Grab the OpenGL RenderSystem, or exit
Ogre::RenderSystem* rs = mRoot->getRenderSystemByName("OpenGL Rendering Subsystem");
if(!(rs->getName() == "OpenGL Rendering Subsystem"))
{
    return false; //No RenderSystem found
}
// configure our RenderSystem
rs->setConfigOption("Full Screen", "No");
rs->setConfigOption("VSync", "No");
rs->setConfigOption("Video Mode", "800 x 600 @ 32-bit");
 
mRoot->setRenderSystem(rs);
 
mWindow = mRoot->initialise(true, "LowLevelOgre Render Window");

Tổng  kết

Đây là nội dung cơ bản về Ogre Wiki Tutorial Framework. Ở bài tới, ta sẽ bắt tay vào xây dựng ứng dụng đầu tiên. :-)
more.
Credits Credits