本文整理汇总了C++中vec3::y方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3::y方法的具体用法?C++ vec3::y怎么用?C++ vec3::y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3
的用法示例。
在下文中一共展示了vec3::y方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
vec3 vec3::operator+=(vec3 rhs) {
return vec3( m_vec[0] + rhs.x(),
m_vec[1] + rhs.y(),
m_vec[2] + rhs.z());
}
示例2: return
bool vec3::operator==(vec3 rhs) {
return(m_vec[0] == rhs.x() && m_vec[1] == rhs.y() && m_vec[2] == rhs.z());
}
示例3: pca
void
SceneIdeasPrivate::draw()
{
viewFromSpline_.getCurrentVec(currentTime_, viewFrom_);
viewToSpline_.getCurrentVec(currentTime_, viewTo_);
lightPosSpline_.getCurrentVec(currentTime_, lightPos_);
logoPosSpline_.getCurrentVec(currentTime_, logoPos_);
logoRotSpline_.getCurrentVec(currentTime_, logoRot_);
// Tell the logo its new position
logo_.setPosition(logoPos_);
vec4 lp4(lightPos_.x(), lightPos_.y(), lightPos_.z(), 0.0);
//
// SHADOW
//
modelview_.loadIdentity();
modelview_.lookAt(viewFrom_.x(), viewFrom_.y(), viewFrom_.z(),
viewTo_.x(), viewTo_.y(), viewTo_.z(),
0.0, 1.0, 0.0);
float pca(0.0);
if (viewFrom_.y() > 0.0)
{
table_.draw(modelview_, projection_, lightPos_, logoPos_, currentTime_, pca);
}
glEnable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
if (logoPos_.y() < 0.0)
{
// Set the color assuming we're still under the table.
uvec3 flatColor(128 / 2, 102 / 2, 179 / 2);
if (logoPos_.y() > -0.33)
{
// We're emerging from the table
float c(1.0 - logoPos_.y() / -0.33);
pca /= 4.0;
flatColor.x(static_cast<unsigned int>(128.0 * (1.0 - c) * 0.5 + 255.0 * pca * c));
flatColor.y(static_cast<unsigned int>(102.0 * (1.0 - c) * 0.5 + 255.0 * pca * c));
flatColor.z(static_cast<unsigned int>(179.0 * (1.0 - c) * 0.5 + 200.0 * pca * c));
}
modelview_.push();
modelview_.scale(0.04, 0.0, 0.04);
modelview_.rotate(-90.0, 1.0, 0.0, 0.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.z()), 0.0, 0.0, 1.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.y()), 0.0, 1.0, 0.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.x()), 1.0, 0.0, 0.0);
modelview_.rotate(0.1 * 353, 1.0, 0.0, 0.0);
modelview_.rotate(0.1 * 450, 0.0, 1.0, 0.0);
logo_.draw(modelview_, projection_, lightPositions_[0], SGILogo::LOGO_FLAT, flatColor);
modelview_.pop();
}
if (logoPos_.y() > 0.0)
{
modelview_.push();
modelview_.translate(lightPos_.x(), lightPos_.y(), lightPos_.z());
mat4 tv;
tv[3][1] = -1.0;
tv[3][3] = 0.0;
tv[0][0] = tv[1][1] = tv[2][2] = lightPos_.y();
modelview_ *= tv;
modelview_.translate(-lightPos_.x() + logoPos_.x(),
-lightPos_.y() + logoPos_.y(),
-lightPos_.z() + logoPos_.z());
modelview_.scale(0.04, 0.04, 0.04);
modelview_.rotate(-90.0, 1.0, 0.0, 0.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.z()), 0.0, 0.0, 1.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.y()), 0.0, 1.0, 0.0);
modelview_.rotate(0.1 * static_cast<int>(10.0 * logoRot_.x()), 1.0, 0.0, 0.0);
modelview_.rotate(35.3, 1.0, 0.0, 0.0);
modelview_.rotate(45.0, 0.0, 1.0, 0.0);
logo_.draw(modelview_, projection_, lightPositions_[0], SGILogo::LOGO_SHADOW);
modelview_.pop();
}
//
// DONE SHADOW
//
glEnable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
modelview_.loadIdentity();
modelview_.lookAt(viewFrom_.x(), viewFrom_.y(), viewFrom_.z(),
viewTo_.x(), viewTo_.y(), viewTo_.z(),
0.0, 1.0, 0.0);
modelview_.push();
modelview_.translate(lightPos_.x(), lightPos_.y(), lightPos_.z());
modelview_.scale(0.1, 0.1, 0.1);
float x(lightPos_.x() - logoPos_.x());
float y(lightPos_.y() - logoPos_.y());
float z(lightPos_.z() - logoPos_.z());
//.........这里部分代码省略.........
示例4: lengthFromAngstroms
vec3 UnitConverter::lengthFromAngstroms(vec3 position)
{
return vec3(UnitConverter::lengthFromAngstroms(position.x()), UnitConverter::lengthFromAngstroms(position.y()), UnitConverter::lengthFromAngstroms(position.z()));
}
示例5: tangent_space_to_world_space
vec3 tangent_space_to_world_space(const vec3& v, const vec3& nrm)
{
const vec3& t1 = perpendicular(nrm);
const vec3& t2 = cross(nrm, t1);
return (v.x() * t1 + v.y() * t2 + v.z() * nrm).normalized();
}
示例6: velocityFromSI
vec3 UnitConverter::velocityFromSI(vec3 velocity)
{
return vec3(UnitConverter::velocityFromSI(velocity.x()), UnitConverter::velocityFromSI(velocity.y()), UnitConverter::velocityFromSI(velocity.z()));
}
示例7: lengthToSI
vec3 UnitConverter::lengthToSI(vec3 position)
{
return vec3(UnitConverter::lengthToSI(position.x()), UnitConverter::lengthToSI(position.y()), UnitConverter::lengthToSI(position.z()));
}
示例8:
/*!
Initializes vec3 class by copying the values of \a v .
*/
coordinates::coordinates(vec3 v) : vec3(v.x(), v.y(), v.z())
{
}
示例9:
/** \brief Accessor.
*
* \return Maximum y coordinate.
*/
T y2() const
{
return m_pnt_max.y();
}