1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

Sprout.Darkroom 外部ファイルからテクスチャ読み込み機能を追加

texture_map クラス追加
This commit is contained in:
bolero-MURAKAMI 2011-12-17 18:00:41 +09:00
parent c0309c22ed
commit 6f2be58007
7 changed files with 368 additions and 11 deletions

View file

@ -135,12 +135,12 @@ namespace sprout {
)
;
}
template<typename Ray, typename Point>
template<typename Ray, typename Vec>
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_6(
Ray const& ray,
zwo_type const& zwo,
drei_type const& drei,
Point const& poi
Vec const& normal
) const
{
using std::atan2;
@ -153,19 +153,19 @@ namespace sprout {
sprout::darkroom::materials::calc_material( // ! Spherical
mat_,
atan2(
sprout::darkroom::coords::x(poi),
sprout::darkroom::coords::z(poi)
sprout::darkroom::coords::z(normal),
sprout::darkroom::coords::x(normal)
)
/ (2 * pi)
/ pi
,
atan2(
sprout::darkroom::coords::y(normal),
sqrt(
sprout::darkroom::coords::x(poi) * sprout::darkroom::coords::x(poi)
+ sprout::darkroom::coords::y(poi) * sprout::darkroom::coords::y(poi)
),
sprout::darkroom::coords::z(poi)
sprout::darkroom::coords::x(normal) * sprout::darkroom::coords::x(normal)
+ sprout::darkroom::coords::z(normal) * sprout::darkroom::coords::z(normal)
)
)
/ (2 * pi)
/ (pi / 2)
)
);
}
@ -180,7 +180,7 @@ namespace sprout {
ray,
zwo,
drei,
sprout::tuples::get<dr::point_of_intersection>(drei)
sprout::tuples::get<dr::normal>(drei)
);
}
template<typename Ray>