multiple openGL irrlichtDevice
it works now. i'm using Qt Creator instead of C::B
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
I prefer using C::B when an application get more complicated.
To get it working I just followed the Wiki:
http://code.google.com/p/qtworkbench/wi ... chProjects
To get it working I just followed the Wiki:
http://code.google.com/p/qtworkbench/wi ... chProjects
another question... the left, middle and right clicks are working fine in my qt-irrlicht app but how come I can't drag anything?
for example I opened a file dialogue (irrlicht's gui), it appears in my irrlicht widget, I can press the buttons or select a file but I can't drag-moving the file selector window as well as the scrollbar... any idea?
for example I opened a file dialogue (irrlicht's gui), it appears in my irrlicht widget, I can press the buttons or select a file but I can't drag-moving the file selector window as well as the scrollbar... any idea?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
bump
hmm no one know the reason why?
hmm no one know the reason why?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
i'm not sure whether i'm doing the right thing or not, i created an event receiver for mouse clicking (for mesh selection) but when i click on the irrlicht widget the whole program crashes. hmm anyone know how to do it in a correct way?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
Don't jump, Virion saved your life.
You have to grab the keyboard input when initialize the widget class.
this->grabKeyboard();
http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
You have to grab the keyboard input when initialize the widget class.
this->grabKeyboard();
http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
Thanks Escence,
but I figure I must be missing something.
And that something is: where is the message loop?
So app.exec() in main captures Qt events, and we have mapped selctively some keys of Qt to Irrlicht, but where should the Irrlicht message loop be? Now we cant have it in main.cpp obviously... so... humn... (scratching head)
I'm probably missing something very fundamental here that everyone else seems to know... well, since I'm quite a beginner in Irrlicht, please forgive me.
Any help would be much appreciated!
/regards
but I figure I must be missing something.
And that something is: where is the message loop?
So app.exec() in main captures Qt events, and we have mapped selctively some keys of Qt to Irrlicht, but where should the Irrlicht message loop be? Now we cant have it in main.cpp obviously... so... humn... (scratching head)
I'm probably missing something very fundamental here that everyone else seems to know... well, since I'm quite a beginner in Irrlicht, please forgive me.
Any help would be much appreciated!
/regards
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
xirtamatrix wrote:Thanks Escence,
but I figure I must be missing something.
And that something is: where is the message loop?
So app.exec() in main captures Qt events, and we have mapped selctively some keys of Qt to Irrlicht, but where should the Irrlicht message loop be? Now we cant have it in main.cpp obviously... so... humn... (scratching head)
I'm probably missing something very fundamental here that everyone else seems to know... well, since I'm quite a beginner in Irrlicht, please forgive me.
Any help would be much appreciated!
/regards
Or is it that, since we have the Qt message loop running, we dot need a seperate Irrlicht message loop... well.. that would be logical. But then, why the hell camera dont move! Not even with this->grabkeyboard() thingy, it still dont move. darn!
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
Maybe try this to get it working.
First you have to make sure you are using a FPS camera.
Tell QT to enable mousetracking when initialize the widget class, and grab keyboard.
Declare mouseMoveEvent in your header file:
Paste Method to your class:
Cheers,
Escen
First you have to make sure you are using a FPS camera.
Code: Select all
scene::ICameraSceneNode* cam = manager->addCameraSceneNodeFPS(0,100,0.5f,-1,0,false,0,false,true );
Code: Select all
setMouseTracking(true);//enable constant mouse movement
this->grabKeyboard();
Declare mouseMoveEvent in your header file:
Code: Select all
virtual void mouseMoveEvent( QMouseEvent* event );
Code: Select all
void QIrrlichtWidget::mouseMoveEvent( QMouseEvent* event )
{
irr::SEvent irrEvent;
irrEvent.EventType = irr::EET_MOUSE_INPUT_EVENT;
if ( device != 0 )
{
irrEvent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
irrEvent.MouseInput.X = event->x();
irrEvent.MouseInput.Y = event->y();
irrEvent.MouseInput.Wheel = 0.0f; // Zero is better than undefined
device->postEventFromUser( irrEvent );
}
event->ignore();
};
Don't do that to much, or you getting bald early.... so... humn... (scratching head)
Cheers,
Escen
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
Thanks a bundle Escen! God bless you... I mean.... umn.. whatever you believe in bless you... ah heck, well let em all just bless you. Yeps that better... people of the world, go all bless Escen!
how stupid of me, once again I had not properly looked into Irrlicht cause I was too busy digging into Qt... so.. yes... I had a standard camera which obviously did not provide any key/mouse movement and I had no method of my own to handle that either! blast!
So far so good! I truely appreciate the time you took to write and explain the code, many many thanks again!
One little thing though, this FPS camera is probably the worst invention of mankind and I'd been trying to change it to something more civilized, tried the Maya camera but thats not what I want either, so I figure will have to write my own camera. I've been searching the forums for some reliable 3rd person camera method... do you happen to know any? Or, if you have some decent working camera, could you kindly share the code?
Cheers mate!
XirtamatriX
how stupid of me, once again I had not properly looked into Irrlicht cause I was too busy digging into Qt... so.. yes... I had a standard camera which obviously did not provide any key/mouse movement and I had no method of my own to handle that either! blast!
So far so good! I truely appreciate the time you took to write and explain the code, many many thanks again!
One little thing though, this FPS camera is probably the worst invention of mankind and I'd been trying to change it to something more civilized, tried the Maya camera but thats not what I want either, so I figure will have to write my own camera. I've been searching the forums for some reliable 3rd person camera method... do you happen to know any? Or, if you have some decent working camera, could you kindly share the code?
LOL, and I been wondering where do my hair keep disappearing.Escen wrote: Don't do that to much, or you getting bald early.
Cheers,
Escen
Cheers mate!
XirtamatriX
I'm using FPS camera with Qt too and it's cool. I'm using Qt's input for almost everything except when moving around with FPS camera, which I transfer the input from Qt to Irrlicht. When I don't have to move around I can switch back to normal, static camera using right click.
conclusion: FPSCamera rocks.
conclusion: FPSCamera rocks.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
So you like the FPS camera and I dont, guess we can live with itVirion wrote:I'm using FPS camera with Qt too and it's cool. I'm using Qt's input for almost everything except when moving around with FPS camera, which I transfer the input from Qt to Irrlicht. When I don't have to move around I can switch back to normal, static camera using right click.
conclusion: FPSCamera rocks.
Depends on the needs of your application though.
What annoys me most is the mouse grabbing behaviour of it for rotation, I dont want it, instead, I want to rotate when user clicks-holds-drags the mouse to a certain direction, as in the maya camera. But the problem with Maya camera is when you drag it up or down it rotates, insted I would want it to move in the Z direction. The keys behaviour of FPS is ok, left and right moves to left and right and up/down moves in Z direction.
I read somewhere its not a good idea to modify existing cameras, hence looking forward to write my own camera.
EDIT: ideally though, I'd like to provide a choice of at least 2 cameras, one FPS style but without mouse-locking, and another 3rd-person-follow style which follows the avatar.
cheers!
Im creating two different windows and when the second is attached to irrlicht with CreateDeviceEx, the first seems to get corrupted. Can you explain how to solve this problem? You said its because OpenGL is not supporting rendering from the same threads. I dont understand this. How should it work?
In Direct3D its fine, but I need to use OpenGL!
In Direct3D its fine, but I need to use OpenGL!
Tomi