generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Roblox » Suggestions & Ideas
Home Search
 

Roblox Screen to world space.

Previous Thread :: Next Thread 
SciGuy2002 is not online. SciGuy2002
Joined: 24 Sep 2016
Total Posts: 34
06 Oct 2016 07:00 AM
It is a coding effort to make any game playable for Xbox and one thing besides selecting GUI is being able to click using joysticks in roblox.

I could get around this using a 2D sprite moving on screen but i need it to get the 3D world position. It could also be done were you can move the mouse cursor via script instead and have it enabled via script on console to allow all the mouse functions but keep it an option for advanced users.

Report Abuse
Keruro is not online. Keruro
Joined: 23 Nov 2013
Total Posts: 2327
06 Oct 2016 07:35 AM
What?


Report Abuse
sonickyle is not online. sonickyle
Joined: 01 Jan 2009
Total Posts: 5653
06 Oct 2016 07:38 AM
Scriptable.
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
06 Oct 2016 09:20 AM
scriptable


Report Abuse
SciGuy2002 is not online. SciGuy2002
Joined: 24 Sep 2016
Total Posts: 34
06 Oct 2016 12:26 PM
I would like help then if it is scriptable with in reason. Roblox has a world to screen space function so why not the other way around.

I know it is scriptable but to do it in lua it gets realy in efficent.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Oct 2016 12:27 PM
They do have it the other way around. Here it is:

http://wiki.roblox.com/index.php?title=API:Class/Camera/ScreenPointToRay
Report Abuse
SciGuy2002 is not online. SciGuy2002
Joined: 24 Sep 2016
Total Posts: 34
06 Oct 2016 12:30 PM
Thanks for this. I guess my google keywords wernt that good for finding this.

I still think it would be cool. Thank you for the help.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Oct 2016 12:37 PM
Np :D
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
06 Oct 2016 12:43 PM
local function ScreenToWorld(screenPoint, screenSize, pushDepth)
local cameraFOV, cameraCFrame = Camera.FieldOfView, Camera.CoordinateFrame
local imagePlaneDepth = screenSize.y / (2 * math.tan(math.rad(cameraFOV) / 2))
local direction = Vector3.new(screenPoint.x - (screenSize.x / 2), (screenSize.y / 2) - screenPoint.y, -imagePlaneDepth)
local worldDirection = (cameraCFrame:vectorToWorldSpace(direction)).Unit
local theta = math.acos(math.min(1, worldDirection:Dot(cameraCFrame.lookVector)))
local fixedPushDepth = pushDepth / math.sin((math.pi / 2) - theta)
return cameraCFrame.p + worldDirection * fixedPushDepth
end

from PopperCam


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Suggestions & Ideas
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image