Examples of Vector4


Examples of engine.base.Vector4

      System.err.println("Invalid channel access in " + this);
    return OutputType.SCALAR;
  }

  private final Vector4 _function(Vector4 in0, Vector4 normalmap) {
    normalmap.add_ip(new Vector4(-0.5f));
    normalmap.mult_ip(2.0f);
    Vector3 lightDir = new Vector3();
    lightDir.setDir(theta.get() * (FMath.PI / 180.0f), phi.get() * (FMath.PI / 180.0f));

    Vector3 reflect = (new Vector3(0, 0, -1)).reflect(normalmap.getVector3());
View Full Code Here

Examples of engine.base.Vector4

  protected void cache_function(Vector4 out, TileCacheEntry[] caches, int localX, int localY, float u, float v) {
    _function(out, caches[0].sample(localX, localY), caches[1].sample(localX, localY), caches[2].sample(localX, localY), caches[3].sample(localX, localY));
  }
   
  protected Vector4 _valueRGBA(float u, float v) {
    Vector4 c0 = inputChannels[0].valueRGBA(u, v);
    Vector4 c1 = inputChannels[1].valueRGBA(u, v);
    Vector4 c2 = inputChannels[2].valueRGBA(u, v);
    Vector4 c3 = inputChannels[3].valueRGBA(u, v);
    Vector4 ret = new Vector4();

    _function(ret, c0, c1, c2, c3);
   
    return ret;
  }
View Full Code Here

Examples of engine.base.Vector4

    else System.err.println("Invalid channel access in " + this);
    return OutputType.SCALAR;
  }

  private final Vector4 _function(Vector4 in0, float u, float v) {
    Vector4 c = new Vector4(in0);
    float m = modulus.get();
    float s = normalize.get() ? 1f / m : 1f;
    float bias = u * m * xBias.get();
    c.x = Math.max(0.0f, Math.min(1.0f, ((c.x + bias) % m) * s));
    c.y = Math.max(0.0f, Math.min(1.0f, ((c.y + bias) % m) * s));
 
View Full Code Here

Examples of engine.base.Vector4

    out.set(_function(caches[0].sample(localX, localY), u, v));
  }


  protected Vector4 _valueRGBA(float u, float v) {
    Vector4 c0 = inputChannels[0].valueRGBA(u, v);
    return _function(c0, u, v);
  }
View Full Code Here

Examples of engine.base.Vector4

    return OutputType.RGBA;
  }
 
 
  private Vector4 performFilter(Vector4 out, TileCacheEntry[] caches, float u, float v) {
    Vector4 val = new Vector4();
   
    float r = radius.get()/100.0f;
    float weightSum = 0.0f;
   
    float rotU = FMath.cos(FMath.PI*angle.get()/180.0f);
    float rotV = FMath.sin(FMath.PI*angle.get()/180.0f);
   
    if (weightFunction.getEnumPos() == 0 && r > 0.0f) { // Gaussian
      for (int i = 0; i < numSamples.get(); i++) {
        float du = (FMath.radicalInverse_vdC(2, i)*2.0f - 1.0f)*r;
        float dv = (FMath.radicalInverse_vdC(3, i)*2.0f - 1.0f)*r;
        // apply anisotropy
        du *= (1.0f - anisotropy.get());
        float nu = du*rotU - dv*rotV;
        float nv = dv*rotU + du*rotV;
        du = nu;
        dv = nv;

        float l = FMath.sqrt(du*du + dv*dv);
        float w = FMath.exp(-(l/r));
       
       
        if (caches != null) val.add_ip(caches[0].sample_Normalized(du+u, dv+v).mult_ip(w));
        else val.add_ip(inputChannels[0].valueRGBA(du+u, dv+v).mult_ip(w));
        weightSum += w;
      }
    } else { // Box
      for (int i = 0; i < numSamples.get(); i++) {
        float du = (FMath.radicalInverse_vdC(2, i)*2.0f - 1.0f)*r;
        float dv = (FMath.radicalInverse_vdC(3, i)*2.0f - 1.0f)*r;
        // apply anisotropy
        du *= (1.0f - anisotropy.get());
        float nu = du*rotU - dv*rotV;
        float nv = dv*rotU + du*rotV;
        du = nu;
        dv = nv;

        if (caches != null) val.add_ip(caches[0].sample_Normalized(du+u, dv+v));
        else val.add_ip(inputChannels[0].valueRGBA(du+u, dv+v));
        weightSum += 1.0f;
      }
   
    }
   
    val.mult_ip(1.0f/weightSum);
    if (out != null) out.set(val);
    return val;
  }
View Full Code Here

Examples of engine.base.Vector4

    float mx = (u * rx) - x;
    float my = (v * ry) - y;
    x = x%rx;
    y = y%ry;
   
    Vector4 c0 = Utils.RGBAToVector4(img.getRGB(x, y));
    Vector4 c1 = Utils.RGBAToVector4(img.getRGB((x+1)%rx, y));
    Vector4 c2 = Utils.RGBAToVector4(img.getRGB(x, (y+1)%ry));
    Vector4 c3 = Utils.RGBAToVector4(img.getRGB((x+1)%rx, (y+1)%ry));
   
    c0.linearInterp_ip(mx, c1);
    c2.linearInterp_ip(mx, c3);
    c0.linearInterp_ip(my, c2);
   
View Full Code Here

Examples of engine.base.Vector4

 
 
  protected Vector4 _valueRGBA(float u, float v) {
    BufferedImage img = image.getImage();
    if (img == null) {
      return new Vector4(0, 0, 0, 0);
    } else {
      if (interpolation.getEnumPos() == 0) return sampleColorNearest(img, u, v);
      else return sampleColorLinear(img, u, v);
    }
  }
View Full Code Here

Examples of gwlpr.protocol.util.Vector4

        p.uInt = 3;
        p.uLong = 4;
        p.single = 5.0F;
        p.vec2 = new Vector2(6.0F, 7.0F);
        p.vec3 = new Vector3(8.0F, 9.0F, 10.0F);
        p.vec4 = new Vector4(11.0F, 12.0F, 13.0F, 14.0F);
        p.dw3 = new WorldPosition(15.0F, 16.0F, 17.0F, 18);
        p.vint = 19;
        p.ascii = "20";
        p.utf16 = "21";
        p.constBuf = new byte[] {(byte)22, (byte)23};
View Full Code Here

Examples of jmt.engine.graphic.Vector4

    vertices[2] = v2;
    return vertices;
  }

  public void updateNormal() {
    Vector4 vv0 = Vector4.createPoint3D(v0.x(), v0.y(), v0.z());
    Vector4 vv1 = Vector4.createPoint3D(v1.x(), v1.y(), v1.z());
    Vector4 vv2 = Vector4.createPoint3D(v2.x(), v2.y(), v2.z());
    vv1.subSelf(vv0);
    vv2.subSelf(vv0);
    vv1.crossSelf(vv2);
    normal = vv1;
    normal.normalize();
  }
View Full Code Here

Examples of jmt.engine.graphic.Vector4

    else
      return 0;
  }

  public boolean isCoplanar(HullFace face) {
    Vector4 diff = this.normal.clone();
    diff.subSelf(face.normal);
    if (Math.abs(diff.x()) > COPLANAR_EPSILON
        || Math.abs(diff.y()) > COPLANAR_EPSILON
        || Math.abs(diff.z()) > COPLANAR_EPSILON) {
      return false;
    } else {
      return true;
    }
  }
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.