move object with mouse hints?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
miroslav_karpis
Posts: 12
Joined: Tue Jan 13, 2009 7:12 am

move object with mouse hints?

Post by miroslav_karpis »

Hi,
does anybody have some hints, maybe examples for moving objects with mouse? (for example when I click on button the button will go a bit Z-axis).
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

irrlicht 1.5 example 19.MouseAndJoystick
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

If you can be specific about what you want to do, I'm sure someone will provide a small sample. I'm not sure what you mean by "click on button the button will go a bit Z-axis". A button is a 2D entity, while Z axis is (generally) depth.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
miroslav_karpis
Posts: 12
Joined: Tue Jan 13, 2009 7:12 am

Post by miroslav_karpis »

I mean that I have a 3d model of a button. When I click on that specific object (the button) I want that it moves Z-axis.

Confusing for me is that for example what kind of 'node' can be 'animatable' (here I mean change, position).
  • ISceneNode?
    IAnimatedMesh?
    IMesh? - because of this 'button' object is not animated by origin, it can be defined like IMesh, or?
    Everything?
(but earlier or later I will figure that out) :shock:

Maybe this image would help?

Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

miroslav_karpis wrote:Confusing for me is that for example what kind of 'node' can be 'animatable' (here I mean change, position).
  • ISceneNode?
    IAnimatedMesh?
    IMesh? - because of this 'button' object is not animated by origin, it can be defined like IMesh, or?
    Everything?
any node can be moved (except of the skybox/skydome nodes)... ;)
but remember meshes are not nodes !!!
you can easily check this with the API...
all moveble obects have a function called "setPosition(...)"... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

ISceneNode is the basic building block. Almost everything besides GUI is an ISceneNode. Scene nodes can rotate, move, scale, and change materials.
IMesh and IAnimatedMesh are the basic geometry containers. The vertex positions are in object space and are usually fixed for IMesh, but changing over time for IAnimatedMesh.
So your buttons will probably be IMeshSceneNodes holding IMeshes for the geometry, but being moved via the ISceneNode interface (as they don't change their shape).
Post Reply