New answers tagged raytracing
Generating random directions efficiently is a major issue, especially in GPU implementations of anything like ray tracing. In my research about the matter I've been using an implementation described here. The solution refers to single values but can be easly applied to vectors as well. In my applications I generate random vectors using two methods: by ...
If You are working on Windows, CUDA tend to lag a bit due to WDDM feature. With my own CUDA raytracing implementation on Ubuntu 14.04 I get about 55 FPS on GTX 560 Ti, while on Windows 7 with GTX 970 on board I get only about 16 FPS, with the exact same code in both cases (i.e. a single ray per pixel solution). See this for more info about the issue.
You can specify a coordinate system given the normal N and another vector. We'll choose wi. So any vector that has the same direction as wi when projected onto the tangent plane will have an azimuth of 0 First, we project wi on the tangent plane: (assuming wi is already normalized) wit = normalize(wi - N * dot(wi, N)) now, we can do the same with wo: ...
Looks like you need to restrict the euler angles of the turret, after the quaternion rotation has been effected. basically you'd just do something like: transform.localEulerAngles = new Vector3(transform.localEulerAngles.x < 0 ? 0 : transform.localEulerAngles.x, transform.localEulerAngles.y, transform.localEulerAngles.z); ...I think X is the right axis ...
Top 50 recent answers are included