OgreDotNet C# Intermediate Tutorial 4 posted
I posted intermediate tutorial 4.
CAVEAT: I had to make a small change to OgreRoot.i, reswig and recompile my ODN dlls because the OGRE tutorial uses this function:
and _setCurrentSceneManager( SceneManager sm) has an entry
if you want to use this tutorial with the current code base, you'll have to remove that ignore line and reswig and recompile too.
my hope is that there is another way to do what _setCurrentSceneManager does that doesn't require recompiling ODN.. if you know what it is, please update the tutorial and let everyone know here in this thread.
I updated cvs last night (04-23-2006), removing that ignore.
I just want to say DigitalCyborg and ElectricBliss, you guys are doing a greate job converting the tutorials.
Thanks for the update. DC is the one spearheading the tutorials. I'm just following up behind with minor cleanup.
*And* I believe that there are still small fixes here and there that I might have missed... so if anyone sees a typo or mistake please feel free to fix 'em.
I've been inundated with ‘real’ work and haven’t had as much time as I’d like to work w/ odn… I’m hoping to get back soon…
Can i have access to Wiki, so i can post converted VB.NET Tutorials? Or do i need to do this another way?
Use your "Main Forum" login for the wiki.
I followed the tutorial to try to pick a .mesh object but my RaySceneQuery.execute() returns a empty RaySceneQueryResult all the time.
Ray mouseRay = Jogo._Camera.GetCameraToViewportRay(e.X, e.Y);
Jogo._CollisionResult = Jogo._RaySceneQuery.execute();
It happens even when the cursor is right on a .mesh object (Actually I only test with .mesh objects).
I´m using a SceneType.Generic scene but I got the same result with a SceneType.ExteriorClose scene.
I´m using windows forms and my OgreDotNet.EventHandle doesn´t handle the mouse and keyboard inputs. The mouse location, captured with Panel Event and passed to GetCameraToViewportRay method, is allways in the viewport.
What can be wrong?
if you aren't using the OgreDotNet event handlers, but are using a mouse click event on a windows form panel then the e.X and e.Y are returning int values while the GetCameraToViewportRay is expecting floats in the range [0,1].
so you need to divide the e.X and e.Y values by the size of your viewport/panel.
The following code is a example where the panel/viewport is 800x600 (you should really use the properties of the panel to find its size though rather than hard code them like here.
Ray mouseray=appl.camera.GetCameraToViewportRay((float) e.X/800,(float)e.Y/600);
RaySceneQueryResult result = appl.mRayQuery.execute();
Thanks a lot.
I should read the documentation more but I would never think the problem could be in this method.