Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Vector3.x()


     * @see ca.eandb.jmist.framework.path.EyeNode#project(ca.eandb.jmist.math.HPoint3)
     */
    public Point2 project(HPoint3 x) {
      Ray3 ray = new Ray3(Point3.ORIGIN, x);
      Vector3 v = ray.direction().unit();
      double phi = Math.atan2(v.x(), -v.z());
      if (Math.abs(phi) > 0.5 * hfov) {
        return null;
      }
      double theta = Math.asin(v.y());
      if (Math.abs(theta) > 0.5 * vfov) {
View Full Code Here


   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#getTextureCoordinates(ca.eandb.jmist.framework.geometry.AbstractGeometry.GeometryIntersection)
   */
  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {
    Vector3          n = x.getNormal();
    SphericalCoordinates  sc = SphericalCoordinates.fromCartesian(new Vector3(n.x(), -n.z(), n.y()));

    return new Point2(
        (Math.PI + sc.azimuthal()) / (2.0 * Math.PI),
        sc.polar() / Math.PI
    );
View Full Code Here

    Vector3    orig  = this.base.vectorTo(ray.origin());
    Vector3    dir    = ray.direction();

    Polynomial  f    = new Polynomial(
                orig.x() * orig.x() + orig.z() * orig.z() - this.radius * this.radius,
                2.0 * (orig.x() * dir.x() + orig.z() * dir.z()),
                dir.x() * dir.x() + dir.z() * dir.z()
              );
    double[]  x    = f.roots();

    if (x.length == 2)
View Full Code Here

    Vector3    dir    = ray.direction();

    Polynomial  f    = new Polynomial(
                orig.x() * orig.x() + orig.z() * orig.z() - this.radius * this.radius,
                2.0 * (orig.x() * dir.x() + orig.z() * dir.z()),
                dir.x() * dir.x() + dir.z() * dir.z()
              );
    double[]  x    = f.roots();

    if (x.length == 2)
    {
View Full Code Here

    Vector3    dir    = ray.direction();

    Polynomial  f    = new Polynomial(
                orig.x() * orig.x() + orig.z() * orig.z() - this.radius * this.radius,
                2.0 * (orig.x() * dir.x() + orig.z() * dir.z()),
                dir.x() * dir.x() + dir.z() * dir.z()
              );
    double[]  x    = f.roots();

    if (x.length == 2)
    {
View Full Code Here

   */
  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {

    Vector3    r    = this.base.vectorTo(x.getPosition());
    double    tx    = (Math.PI + Math.atan2(r.z(), r.x())) / (2.0 * Math.PI);
    double    ty;

    switch (x.getTag()) {

    case CYLINDER_SURFACE_BASE:
View Full Code Here

    double    ty;

    switch (x.getTag()) {

    case CYLINDER_SURFACE_BASE:
      ty = Math.sqrt(r.x() * r.x() + r.z() * r.z()) / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_TOP:
      ty = 1.0 - Math.sqrt(r.x() * r.x() + r.z() * r.z())
          / (4.0 * this.radius);
 
View Full Code Here

    double    ty;

    switch (x.getTag()) {

    case CYLINDER_SURFACE_BASE:
      ty = Math.sqrt(r.x() * r.x() + r.z() * r.z()) / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_TOP:
      ty = 1.0 - Math.sqrt(r.x() * r.x() + r.z() * r.z())
          / (4.0 * this.radius);
 
View Full Code Here

    case CYLINDER_SURFACE_BASE:
      ty = Math.sqrt(r.x() * r.x() + r.z() * r.z()) / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_TOP:
      ty = 1.0 - Math.sqrt(r.x() * r.x() + r.z() * r.z())
          / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_BODY:
      ty = 0.25 + (r.y() / (2.0 * this.height));
 
View Full Code Here

    case CYLINDER_SURFACE_BASE:
      ty = Math.sqrt(r.x() * r.x() + r.z() * r.z()) / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_TOP:
      ty = 1.0 - Math.sqrt(r.x() * r.x() + r.z() * r.z())
          / (4.0 * this.radius);
      break;

    case CYLINDER_SURFACE_BODY:
      ty = 0.25 + (r.y() / (2.0 * this.height));
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.