Help :: Mouse in 3D

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Help :: Mouse in 3D

Post by huydotnet »

I can't use mouse
Who can help me how to use Mouse in 3D Screen? like 3D RPG, RTS... games...
TomiZ
Posts: 40
Joined: Wed Aug 29, 2007 6:02 am
Location: Poland
Contact:

Post 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
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Re: Help :: Mouse in 3D

Post 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?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post by huydotnet »

Yeah! Thank all!
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post 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"
GiongTo35
Posts: 2
Joined: Sat Sep 22, 2007 12:18 pm

Post by GiongTo35 »

In Tut 7 .It's billboard
Last edited by GiongTo35 on Wed Oct 03, 2007 12:54 pm, edited 1 time in total.
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post by huydotnet »

Anyone... please help me.....
@GiongTo35 : Này, ku đừng có spam trong này nhá!
GiongTo35
Posts: 2
Joined: Sat Sep 22, 2007 12:18 pm

Post by GiongTo35 »

The map is octtree . You use irr::scene::IAnimatedMesh . Error :
trivtn
Posts: 132
Joined: Tue Jan 17, 2006 12:30 pm
Location: Viet Nam
Contact:

Post 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.
There's something is fantastic, there's nothing is absolute.
bull
Posts: 36
Joined: Wed Sep 12, 2007 8:49 am
Location: s1Ng4p0R3

Post 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)
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post by huydotnet »

Thank alot
I'll try again :(
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Please, for you own good, ask this question again in the Beginners Help section. You'll get far more help in there.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
david_at_bass
Posts: 3
Joined: Fri Apr 03, 2009 6:14 pm
Location: venezuela

Post 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
Post Reply