Topic: cursor position

How you can bind the object to the cursor? I want to at some moment the object followed by the cursor.

Re: cursor position

Do you want it to look like you are picking up an object?

Re: cursor position

no, I want to make the 3D cursor.

Re: cursor position

I am thinking of several ways you could do this, and you might want to check out Vegas's current post on making a full GUI.

I am sure you would have to use the hideCursor() function though.
You could also use the getWindowScale() function.
Also, taking a look at the Sponza level code could help.

You also might be able to use the rayHit() function and the getUnprojectedPoint() function. You might even use some 3D Math functions.

I need to try to do this myself. If I get something I'll let you know.

Re: cursor position

thanks for the help! I will try to do something.

Last edited by ant0n (2014-01-10 04:02:09)

Re: cursor position

You'll do that using getUnprojectedPoint() :

mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")    
mz = 0.1 -- change this number to move the cursor further : 0.0 correspond to the camera clipping near, 1.0 correspond to the camera clipping far

cursor3d = getUnProjectedPoint(Camera, vec3(mx, my, mz))

Re: cursor position

Thank you, anael! This is what I need!!!