Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_transform.h
| Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | return make_transform( | ||||
| axis.z*axis.x*t - s*axis.y, | axis.z*axis.x*t - s*axis.y, | ||||
| axis.z*axis.y*t + s*axis.x, | axis.z*axis.y*t + s*axis.x, | ||||
| axis.z*axis.z*t + c, | axis.z*axis.z*t + c, | ||||
| 0.0f, | 0.0f, | ||||
| 0.0f, 0.0f, 0.0f, 1.0f); | 0.0f, 0.0f, 0.0f, 1.0f); | ||||
| } | } | ||||
| /* Euler is assumed to be in XYZ order. */ | |||||
| ccl_device_inline Transform transform_euler(float3 euler) | ccl_device_inline Transform transform_euler(float3 euler) | ||||
| { | { | ||||
| return | return | ||||
| transform_rotate(euler.x, make_float3(1.0f, 0.0f, 0.0f)) * | transform_rotate(euler.z, make_float3(0.0f, 0.0f, 1.0f)) * | ||||
| transform_rotate(euler.y, make_float3(0.0f, 1.0f, 0.0f)) * | transform_rotate(euler.y, make_float3(0.0f, 1.0f, 0.0f)) * | ||||
| transform_rotate(euler.z, make_float3(0.0f, 0.0f, 1.0f)); | transform_rotate(euler.x, make_float3(1.0f, 0.0f, 0.0f)); | ||||
| } | } | ||||
| ccl_device_inline Transform transform_orthographic(float znear, float zfar) | ccl_device_inline Transform transform_orthographic(float znear, float zfar) | ||||
| { | { | ||||
| return transform_scale(1.0f, 1.0f, 1.0f / (zfar-znear)) * | return transform_scale(1.0f, 1.0f, 1.0f / (zfar-znear)) * | ||||
| transform_translate(0.0f, 0.0f, -znear); | transform_translate(0.0f, 0.0f, -znear); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines | |||||