HarryDE Posted August 25, 2019 Share Posted August 25, 2019 Hello. So I'd want to create an object on the cursor position. I have calculated everything, it works fine but there are some objects that do not fit to the calculation. I think the problem can be that the bounding box of this objects are also buggy and I don't know what should I change in my calculation. Calculation: local sx, sy = guiGetScreenSize() local relX, relY = getCursorPosition() cursorX, cursorY = relX * sx, relY * sy local camX, camY, camZ = getCameraMatrix() local cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ = getWorldFromScreenPosition(cursorX, cursorY, 1000) local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ = processLineOfSight(camX, camY, camZ, cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ, true, true, true, true, true, true, false, true) Picture about it: (The red lines show the bounding box of the object) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now