Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node.position = SCNVector3(from.x + (to.x - from.x) * 0.5,
- from.y + height * 0.5,
- from.z + (to.z - from.z) * 0.5)
- // orientation of the wall is fairly simple. we only need to orient it around the y axis,
- // and the angle is calculated with 2d math.. now this calculation does not factor in the position of the
- // camera, and so if you move the cursor right relative to the starting position the
- // wall will be oriented away from the camera (in this app the wall material is set as double sided so you will not notice)
- // - obviously if you want to render something on the walls, this issue will need to be resolved.
- node.eulerAngles = SCNVector3(0,
- -atan2(to.x - node.position.x, from.z - node.position.z) - Float.pi * 0.5,
- 0)
Add Comment
Please, Sign In to add comment