Package engine.base

Examples of engine.base.Vector3


          final Vector4 col;
          if (tce == null) col = c.valueRGBA(u, v);
          else col = tce.sample(x, y);
         
          final Vector3 color = new Vector3();
          int val;
          // !!UGH TODO: optimize this!!
          if (mode == 0) {
            color.set(col.getVector3());
            val = Utils.vector3ToINTColor(color);
          } else if (mode == 1) {
            float bg = ((((x + y) / 8) % 2) != 0) ? 1.0f : 0.75f;
            col.x = col.x * col.w + bg * (1.0f - col.w);
            col.y = col.y * col.w + bg * (1.0f - col.w);
            col.z = col.z * col.w + bg * (1.0f - col.w);
            color.set(col.getVector3());
            val = Utils.vector3ToINTColor(color);
          } else if (mode == 2) {
            color.set(col.w);
            val = Utils.vector3ToINTColor(color);
          } else if (mode == 3) {
            color.set(col.getVector3());
            val = Utils.vector4ToINTColor_ARGB(col);
          } else {
            Logger.logError(null, "Wrong in computeImage");
            val = Utils.vector3ToINTColor(color);
          }
View Full Code Here


 
  public FloatBuffer m_CamONB = Utils.allocFloatBuffer(9);
 
  final Vector3 UP = new Vector3(0,0,1);
  void updateCamera() {
    final Vector3 u = new Vector3();
    final Vector3 v = new Vector3();
    final Vector3 w = new Vector3();
    final Vector3 eye = new Vector3();
    float t = (params.rotY.get()-90) * ((float) Math.PI / 180.0f);
    float p = (90 - params.rotX.get()) * ((float) Math.PI / 180.0f);

    w.set(FMath.cos(t) * FMath.sin(p), FMath.sin(t) * FMath.sin(p), FMath.cos(p));
    w.normalize();
    u.cross_ip(UP, w);
    u.normalize();
    v.cross_ip(w, u);
   
   
    m_CamONB.put(0, u.x);
    m_CamONB.put(1, u.y);
    m_CamONB.put(2, u.z);
    m_CamONB.put(3, v.x);
    m_CamONB.put(4, v.y);
    m_CamONB.put(5, v.z);
    m_CamONB.put(6, w.x);
    m_CamONB.put(7, w.y);
    m_CamONB.put(8, w.z);
   
    eye.mult_add_ip(params.camDist.get(), w);

    ARBShaderObjects.glUniform3fARB(u_WS_EyePos_loc, eye.x, eye.y, eye.z);
    ARBShaderObjects.glUniformMatrix3ARB(u_CameraONB_loc, false, m_CamONB);
  }
View Full Code Here

  }

  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());

    float ar = reflect.dot(lightDir);
    if (ar < 0)
      ar = 0;
    ar = FMath.pow(ar, shininess.get());

    in0.add_ip(ar);
View Full Code Here

TOP

Related Classes of engine.base.Vector3

Copyright © 2018 www.massapicom. 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.