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 » Game Creation and Development » Scripters
Home Search
 

Re: convert x y z variables to x y

Previous Thread :: Next Thread 
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
30 Sep 2015 02:40 PM
Basically converting a 3d point to a 2d point for drawing.

Anyone have a lua function that does this? I'm googling but all of them are in c++ (I know c++, its just documented differently though)
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
30 Sep 2015 02:40 PM
just take the x and y and ignore z?

➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
30 Sep 2015 02:45 PM
x=x/z+screenwidth/2
y=y/z+screenheight/2
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
30 Sep 2015 02:45 PM
casting a 3d point onto a 2d plane (perspective) or just removing the z value (orthogonal)?
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
30 Sep 2015 02:46 PM
@notfruit

perspective
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
30 Sep 2015 02:47 PM
use raycasting brah
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
30 Sep 2015 02:49 PM
plane = 0 -- or some other constant...

TwoD = Vector3.new(ThreeD.x, ThreeD.y, Plane)
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
30 Sep 2015 02:51 PM
That was much easier then other websites tutorials.
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
30 Sep 2015 02:52 PM
function 3D2D()
return Vector2.new(v.x/v.z+screenwidth/2,v.y/v.z+screenheight/2)
end



this for perspective 0.0
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
30 Sep 2015 02:52 PM
No,


take a raycast from the persons camera, and have it go to the points you selected, and have it hit a plane behind it. return the position the raycast hits at, and it's a perspective view in 2d


Instance.new("BodyThrust" , Illegallyblind.Pelvis)
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
30 Sep 2015 02:53 PM
function 3D2D(v)
return Vector2.new(v.x/v.z+screenwidth/2,v.y/v.z+screenheight/2)
end typo
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
30 Sep 2015 03:23 PM
@Mininob

I'm guessing v.x,v.y,v.z are just x,y,z?
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
30 Sep 2015 03:46 PM
v=Vector3.new(x,y,z)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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