Last active
September 21, 2015 07:25
-
-
Save cslroot/4eb475710a11f87f174e to your computer and use it in GitHub Desktop.
UnityRayTrace0-1 diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---- 各ピクセルの色を,当たったかどうかで変更する ----- | |
var ray = mainCamera.ScreenPointToRay(new Vector3(w, h, 0.0f)); // カメラからのレイの生成 | |
RaycastHit hit; | |
if (Physics.Raycast(ray, out hit)) { | |
c = new Color(1.0f, 1.0f, 1.0f, 1.0f); // 当たった場合は白(当たらない場合は変更なし) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment