Page 1 of 1

Help :: Mouse in 3D

Posted: Thu Sep 27, 2007 12:43 am
by huydotnet
I can't use mouse
Who can help me how to use Mouse in 3D Screen? like 3D RPG, RTS... games...

Posted: Thu Sep 27, 2007 6:43 am
by TomiZ
In Irrlicht you can use functions like

Code: Select all

irr::scene::ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB

to check what scene node is under mouse cursor.
To check exactly point under mouse cursor use...

Code: Select all

core::line3d<f32> irr::scene::ISceneCollisionManager::getRayFromScreenCoordinates
...to get line from camera to mouse position in 3D world and then

Code: Select all

bool irr::scene::ISceneCollisionManager::getCollisionPoint

Re: Help :: Mouse in 3D

Posted: Thu Sep 27, 2007 2:45 pm
by rogerborg
First, you'll get more responses if you post this in the Beginners Questions forum.
huydotnet wrote:I can't use mouse
Who can help me how to use Mouse in 3D Screen? like 3D RPG, RTS... games...
You'll have to give us more information.

Why can't you use the mouse?

What are you trying to do with it, what do you expect to happen, and what do you see happening instead?

Posted: Thu Sep 27, 2007 3:39 pm
by huydotnet
Thank TomiZ and rogerborg very much

"I can't use mouse"
=> It's first time i use Irrlicht and i don't know how to use mouse

Posted: Thu Sep 27, 2007 4:14 pm
by JP
Check the tutorials...

The GUI tutorial shows you how to use the mouse with the GUI and one of the tutorials using the Quake 3 map shows you how to to scenenode picking with the mouse which may be closer to what you're after.

Posted: Fri Sep 28, 2007 3:50 am
by huydotnet
Yeah! Thank all!

Posted: Sun Sep 30, 2007 3:30 am
by huydotnet
Code like Tut7 - Collision but i get this error messenger :
Compiling...
main.cpp
.\main.cpp(128) : error C2664: 'irr::scene::ISceneManager::createTriangleSelector' : cannot convert parameter 1 from 'irr::scene::IAnimatedMesh *' to 'irr::scene::IMesh *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Build log was saved at "file://c:\Irrlicht\examples\LamNET\Release\BuildLog.htm"

Posted: Tue Oct 02, 2007 3:17 am
by GiongTo35
In Tut 7 .It's billboard

Posted: Tue Oct 02, 2007 3:22 am
by huydotnet
Anyone... please help me.....
@GiongTo35 : Này, ku đừng có spam trong này nhá!

Posted: Tue Oct 02, 2007 3:30 am
by GiongTo35
The map is octtree . You use irr::scene::IAnimatedMesh . Error :

Posted: Wed Oct 03, 2007 6:54 am
by trivtn
Hi huydotnet!
I think you can search in the forum. And in the Tut7 use the mouse for FPS camera, if you want use your custom Camera (as RPG Camera) you must change some code. (getCursorControl(); getSceneCollisionManager(); getRayFromScreenCoordinates(); getSceneNodeFromRayBB())... hope this may help.

Posted: Wed Oct 03, 2007 8:10 am
by bull
You guys are all here?? :D
.\main.cpp(128) : error C2664: 'irr::scene::ISceneManager::createTriangleSelector' : cannot convert parameter 1 from 'irr::scene::IAnimatedMesh *' to 'irr::scene::IMesh *'
change the animatedMesh to animatedMesh->getMesh(0)

Posted: Wed Oct 03, 2007 2:35 pm
by huydotnet
Thank alot
I'll try again :(

Posted: Thu Oct 04, 2007 8:29 am
by rogerborg
Please, for you own good, ask this question again in the Beginners Help section. You'll get far more help in there.

Posted: Tue May 19, 2009 2:44 am
by david_at_bass
thanks a lot, im doing a strategy game and i needed those functions so much, u da man hahahaha 2 thumbs up!!! :D