PDA

View Full Version : select, drag and modify


cellox
02-08-2003, 05:29 PM
Hi,

I have problem about picking, selection with special issue which is "drag and modify" selected object in OpenGL...

Helps, tutorials suggestions or references will greatly be appreciated...

Thanx you all...:)

Dia Kharrat
02-08-2003, 06:55 PM
you could try out the tutorial at http://www.gametutorials.com/Tutorials/ope.../OpenGL_Pg3.htm (http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg3.htm) which is the 4 tutorial down (called: Object Selection). It deals with picking in opengl.

I hope that helps.

cellox
02-08-2003, 07:18 PM
you could try out the tutorial at http://www.gametutorials.com/Tutorials/ope.../OpenGL_Pg3.htm (http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg3.htm) which is the 4 tutorial down (called: Object Selection). It deals with picking in opengl.

I hope that helps.
Well thanx,

I have checked the website and indeed there unfortunately is nothing new to me, only a classical selection
sample code...

But my problem is a bit more complicated as I think...What i want to do is select an object among others, drag it, change position or modify it by draging, and drop it...

This is not so advaced a topic as far as i think but i need help...

Thanx again...

donBerto
02-08-2003, 08:19 PM
sounds like you need to be more specific. you could give us an example of what you want accomplished or maybe show us where you think the problem is by showing some code.

here's something I would do [pseudocode]

. . .
if ( 'picked' and choice_button_down)
click-dragging for this object is enabled.
(picked object's new location) temporary location --> x = current mouse position
(picked object's new location) temporary location --> y = current mouse position

if ( click-dragging for any object was enabled AND no mouse button | dragging is going on)
current or enabled object's new position temporary location
. . .


I hope that places you in the right direction.

my regards.