Topic: cursor position
How you can bind the object to the cursor? I want to at some moment the object followed by the cursor.
You are not logged in. Please login or register.
How you can bind the object to the cursor? I want to at some moment the object followed by the cursor.
Do you want it to look like you are picking up an object?
no, I want to make the 3D cursor.
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.
thanks for the help! I will try to do something.
Last edited by ant0n (2014-01-10 04:02:09)
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))
Thank you, anael! This is what I need!!!
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.