Package fcagnin.jglsdk.glm

Examples of fcagnin.jglsdk.glm.Vec3.scale()


        float cosTheta = (float) Math.cos( theta );
        float cosPhi = (float) Math.cos( phi );
        float sinPhi = (float) Math.sin( phi );

        Vec3 dirToCamera = new Vec3( sinTheta * cosPhi, cosTheta, sinTheta * sinPhi );
        return (dirToCamera.scale( sphereCamRelPos.z )).add( camTarget );
    }


    private Mat4 calcLookAtMatrix(Vec3 cameraPt, Vec3 lookPt, Vec3 upPt) {
        Vec3 lookDir = Glm.normalize( Vec3.sub( lookPt, cameraPt ) );
View Full Code Here


        float cosTheta = (float) Math.cos( theta );
        float cosPhi = (float) Math.cos( phi );
        float sinPhi = (float) Math.sin( phi );

        Vec3 dirToCamera = new Vec3( sinTheta * cosPhi, cosTheta, sinTheta * sinPhi );
        return (dirToCamera.scale( sphereCamRelPos.z )).add( camTarget );
    }


    private Mat4 calcLookAtMatrix(Vec3 cameraPt, Vec3 lookPt, Vec3 upPt) {
        Vec3 lookDir = Glm.normalize( Vec3.sub( lookPt, cameraPt ) );
View Full Code Here

            // Render the sun
            {
                modelMatrix.push();

                Vec3 sunlightDir = new Vec3( lights.getSunlightDirection() );
                modelMatrix.translate( sunlightDir.scale( 500.0f ) );
                modelMatrix.scale( 30.0f, 30.0f, 30.0f );

                glUseProgram( unlit.theProgram );
                glUniformMatrix4( unlit.modelToCameraMatrixUnif, false,
                        modelMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
View Full Code Here

    }
   
   
    private void offsetTargetPos(TargetOffsetDir eDir, float worldDistance, float lastFrameDuration) {
      Vec3 offsetDir = new Vec3(g_offsets[eDir.ordinal()]);
      offsetTargetPos(offsetDir.scale(worldDistance).scale(lastFrameDuration), lastFrameDuration);
    }

    private void offsetTargetPos(Vec3 cameraOffset, float lastFrameDuration) {
      Mat4 currMat = calcMatrix();
      Quaternion orientation = Glm.quatCast(currMat);
View Full Code Here

            // Render the sun
            {
                modelMatrix.push();

                Vec3 sunlightDir = new Vec3( lights.getSunlightDirection() );
                modelMatrix.translate( sunlightDir.scale( 500.0f ) );
                modelMatrix.scale( 30.0f, 30.0f, 30.0f );

                glUseProgram( unlit.theProgram );
                glUniformMatrix4( unlit.modelToCameraMatrixUnif, false,
                        modelMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
View Full Code Here

            // Render the sun
            {
                modelMatrix.push();

                Vec3 sunlightDir = new Vec3( lights.getSunlightDirection() );
                modelMatrix.translate( sunlightDir.scale( 500.0f ) );
                modelMatrix.scale( 30.0f, 30.0f, 30.0f );

                glUseProgram( unlit.theProgram );
                glUniformMatrix4( unlit.modelToCameraMatrixUnif, false,
                        modelMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
View Full Code Here

        // Render the sun
        {
            modelMatrix.push();

            Vec3 sunlightDir = new Vec3( lightEnv.getSunlightDirection() );
            modelMatrix.translate( sunlightDir.scale( 500.0f ) );
            modelMatrix.scale( 30.0f, 30.0f, 30.0f );

            glUseProgram( progUnlit.theProgram );
            glUniformMatrix4( progUnlit.modelToCameraMatrixUnif, false,
                    modelMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
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.