unity3d - points on a plane in 3D -
i'm trying figure out way move objects on 3d plane faces camera using unity3d
. want these objects constrained plane, can move in 3d space (the camera follows it).
to end, thought i'd use plane's coordinate system move objects. figured x,y coordinate on plane have corresponding x,y,z coordinate in actual 3d space. problem is, can't figure out how access, use, or calculate (x,y) coordinates on plane.
i've done research, , i've come across vectors , normals , such, don't understand how pertain particular problem. if i'm looking in right place, explain how? , if i'm not, can point me in right direction? lot.
i thought i'd use plane's coordinate system move objects
that's way go.
i figured x,y coordinate on plane have corresponding x,y,z coordinate in actual 3d space. problem is, can't figure out how access, use, or calculate (x,y) coordinates on plane.
yes that's true. unity3d
gives access quite high level functions, don't have calculation explicitely.
set gameobjects
children of plane
, move them using local coordinate system.
for example:
childobj.transform.parent = plane.transform; childobj.transform.localposition += childobj.transform.forward * offset;
the code above makes childobj
child of plane gameobject
, move forward of offset in local coordinate system.
Comments
Post a Comment