Click here to Skip to main content
15,891,428 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: fancy box popup Pin
Sunasara Imdadhusen3-Sep-14 21:06
professionalSunasara Imdadhusen3-Sep-14 21:06 
AnswerRe: fancy box popup Pin
Sibeesh KV23-Sep-14 19:16
professionalSibeesh KV23-Sep-14 19:16 
QuestionCode I don't understand. Pin
ChicagoBobT28-Aug-14 7:54
ChicagoBobT28-Aug-14 7:54 
I am looking over some code that someone else wrote for three.js
The main.js file starts out with this.

 var APP = {};

(function () {
  "use strict";

  /*global VT,THREE,Detector,requestAnimationFrame*/
  /*jslint browser: true*/

  /***************************************************************************
   * Global Variables
   */

  // three.js variables
  var scene = null;
  var renderer = null;
  var camera = null;
  var controls = null;
  var mesh = null;
  var clock = new THREE.Clock();

  var domContainer = null;
  var virtualTexture = null;

  /***************************************************************************
   * Initialiaze application
   */

  function resize() {
    renderer.setSize(window.innerWidth, window.innerHeight);
    camera.aspect = window.innerWidth / window.innerHeight;
    camera.updateProjectionMatrix();
  }

   .
   .
   .
  APP.load = function (geometry, config) {

    // create virtual texture
    geometry.computeTangents();
    geometry.computeVertexNormals();

    virtualTexture = new THREE.VirtualTexture(renderer.context, config);
    var material = THREE.createVirtualTextureMaterial(virtualTexture);

    mesh = new THREE.Mesh(geometry, material);
    scene.add(mesh);

    THREE.duplicateGeometryForVirtualTexturing(geometry, virtualTexture);
  };
  
}());


and the code ends like above.

I dont get this line (function () {
How does that work or even get called?
The code actually works and not seeing anything like this before
just made me curious.
Hope someone can shed some light on this.


Thanks,
Bob
AnswerRe: Code I don't understand. Pin
Graham Breach28-Aug-14 8:58
Graham Breach28-Aug-14 8:58 
GeneralRe: Code I don't understand. Pin
ChicagoBobT28-Aug-14 11:08
ChicagoBobT28-Aug-14 11:08 
GeneralRe: Code I don't understand. Pin
Sunasara Imdadhusen3-Sep-14 21:08
professionalSunasara Imdadhusen3-Sep-14 21:08 
GeneralRe: Code I don't understand. Pin
Sibeesh KV23-Sep-14 19:17
professionalSibeesh KV23-Sep-14 19:17 
AnswerRe: Code I don't understand. Pin
Anlige2-Sep-14 21:01
Anlige2-Sep-14 21:01 
AnswerRe: Code I don't understand. Pin
Suresh Amudalapalli12-Sep-14 7:49
professionalSuresh Amudalapalli12-Sep-14 7:49 
Questionajax/php issue Pin
RalfPeter28-Aug-14 6:38
RalfPeter28-Aug-14 6:38 
AnswerRe: ajax/php issue Pin
Dennis E White28-Aug-14 8:45
professionalDennis E White28-Aug-14 8:45 
GeneralRe: ajax/php issue Pin
RalfPeter28-Aug-14 8:58
RalfPeter28-Aug-14 8:58 
SuggestionRe: ajax/php issue Pin
Dennis E White28-Aug-14 10:10
professionalDennis E White28-Aug-14 10:10 
Questionweb-based 3D mapping system using nVidia 3D vision Pin
Member 1101681125-Aug-14 6:33
Member 1101681125-Aug-14 6:33 
Questionmodifying Google Search to make results intentionally inaccurate Pin
Member 1103422325-Aug-14 2:11
Member 1103422325-Aug-14 2:11 
AnswerRe: modifying Google Search to make results intentionally inaccurate Pin
Anurag Gandhi25-Aug-14 23:02
professionalAnurag Gandhi25-Aug-14 23:02 
GeneralRe: modifying Google Search to make results intentionally inaccurate Pin
Member 1103422326-Aug-14 0:14
Member 1103422326-Aug-14 0:14 
GeneralRe: modifying Google Search to make results intentionally inaccurate Pin
Anurag.ag31-Aug-14 11:51
Anurag.ag31-Aug-14 11:51 
QuestionInsert Image in to MySql database Pin
Member 1045703324-Aug-14 23:06
professionalMember 1045703324-Aug-14 23:06 
SuggestionRe: Insert Image in to MySql database Pin
ZurdoDev25-Aug-14 3:18
professionalZurdoDev25-Aug-14 3:18 
AnswerRe: Insert Image in to MySql database Pin
Dennis E White25-Aug-14 4:05
professionalDennis E White25-Aug-14 4:05 
SuggestionRe: Insert Image in to MySql database Pin
Siben Nayak29-Aug-14 5:49
professionalSiben Nayak29-Aug-14 5:49 
GeneralRe: Insert Image in to MySql database Pin
Sunasara Imdadhusen3-Sep-14 21:10
professionalSunasara Imdadhusen3-Sep-14 21:10 
QuestioncreateElement, custom style, turn off webkit Appearance Pin
jkirkerx24-Aug-14 10:13
professionaljkirkerx24-Aug-14 10:13 
GeneralRe: createElement, custom style, turn off webkit Appearance Pin
Sunasara Imdadhusen3-Sep-14 21:11
professionalSunasara Imdadhusen3-Sep-14 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.