After figuring out how to compile python-ogre, I happily started following the tutorials
on the wiki. From Intermediate tutorial 2 onwards however they weren't yet updated for python-ogre (they were the same C++ tutorials as on the main ogre wiki).
Over the last few days I've been slowly working on python-versions of the C++ code (which I added to the remaining intermediate tutorials) and I rewrote (to start off with) Intermediate tutorial 2 for Python.
I would appreciate it if someone with more (python-)Ogre experience would take a look to see if I haven't made any large errors. If someone who (like me) is new to Ogre would give it a try and note any problems found, that too would be appreciated.
I think I could do that, I use Ogre since a couple of years now and even if I started in python, I think I can help
First, is your code working? If it's the case, it's a good starting point
Just post your code here and I'll test it.
See the python-ogre wiki
for the code.
I added a python-version of the code to intermediate tutorials 2, 3, 5 and 6 (4 was already converted), and rewrote intermediate tutorial 2. You can simply copy the final version of each tutorial's code and give it a try.
Hey, great work on the tutorials.
While I'm quite busy with my own python-ogre project at the moment(although you might not think it if you've looked at the code) I'd be willing to help too. I've already converted a few of the tutorials from the main ogre wiki into python so I'll upload them as soon as I get the chance.
Thanks! I think python-ogre could really benefit from some effort on the tutorial-front, which is why I dived in. Looking forward to your tutorials as well.
As a side note, I added a Minimal Application
code snippet to the wiki (with buffered events, OIS/CEGUI support and without the use of ExampleFrameListener/SampleFramework). The main ogre wiki has a number of these snippets and I hit a number of snags when setting up a base project, so it might be helpful for others starting out.
Had a look over the intermediate tutorial 2 (sorry for the slow progress i have a lot on) and came up with a small problem. Namely that there are times while moving arround in the map that the camera will infact move below the terrain, I havent fully looked into the reason for this, but here is some code that'll fix it.
Change the frameStarted method to the following:
def frameStarted(self, evt):
if not sf.FrameListener.frameStarted(self, evt):
camPos = self.camera.getPosition()
updateRay = ogre.Ray()
updateRay.setOrigin(camPos + ogre.Vector3(0,10,0))
self.raySceneQuery.Ray = updateRay
for queryResult in self.raySceneQuery.execute():
if queryResult.worldFragment is not None:
self.camera.setPosition(camPos.x, camPos.y - queryResult.distance + 40, camPos.z)
This code is a little more verbose than it needs to be (you can set the origin and direction of the ray from the constructor) but since its a tutorial probably best to leave it as is.
The camera movement in the app also seems a little odd to me, I'll see what I can do about it later. Hope this was helpful
Thanks for working through the tutorial, I've updated it where you indicated. I have made some minor changes as I don't want to deviate too much from the C++ version. I do indeed remember some issues with the camera height and movement, but as I recall the C++ one wasn't perfect either
In the future, feel free to update it directly on the wiki. I'll now work on updating the other tutorials.
To be honest I never actually looked at the C++ version of the tutorial heh
I think its better to have the tutorials as good as possible rather than completely mirroring he C++ one.
I also don't generally like editing other peoples wiki entries (I realise thats the whole point of a wiki, but still
Intermediate tutorial 3 is ready for scrutiny: http://wiki.python-ogre.org/index.php/I
I agree with having the tutorials as good as possible, just as long as they complete the same task in Ogre.
And really, edit my pages as much as you want. If I wanted to write something in stone, I wouldn't put it on a wiki
I realise this is an old topic now but I thought I'd mention that I've recently ported over the 3rd Person camera tutorial from the C++ to here
I haven't been going through the C++ tutorials in any particular order, just porting over the ones I need myself or find interesting.
If anyone has any requests for C++ tutorials you'd like to see on the python-ogre wiki send me a message and I'll do my best (my days are very empty atm