Ejemplo n.º 1
0
void initScene()
{
  currentTicks=SDL_GetTicks();
  totalTime=0.0f;
  //createFramebuffer();
  string modelPath = ASSET_PATH + MODEL_PATH + "/armoredrecon.fbx";
  auto currentGameObject = loadFBXFromFile(modelPath);
  
  string vsPath = ASSET_PATH + SHADER_PATH + "/specularVS.glsl";
  string fsPath = ASSET_PATH + SHADER_PATH + "/specularFS.glsl";
  currentGameObject->loadShader(vsPath, fsPath);
  
  gameObjects.push_back(currentGameObject);
  currentGameObject->setPosition(vec3(0.0f, -10.0f, 0.0f));
  
  modelPath = ASSET_PATH + MODEL_PATH + "/sphere-highpoly.fbx";//
  currentGameObject = loadFBXFromFile(modelPath);
  vsPath = ASSET_PATH + SHADER_PATH + "/textureVS.glsl";
  fsPath = ASSET_PATH + SHADER_PATH + "/textureFS.glsl";
  currentGameObject->loadShader(vsPath, fsPath);
  currentGameObject->setScale(vec3(10.0f, 10.0f, 10.0f));
  
  string texturePath = ASSET_PATH + TEXTURE_PATH + "/mercurymap.png";
  currentGameObject->loadDiffuseMap(texturePath);
  
  gameObjects.push_back(currentGameObject);
}
Ejemplo n.º 2
0
void marsLoader()
{
    string modelPath = ASSET_PATH + MODEL_PATH + "/Planet.fbx";
    auto currentGameObject = loadFBXFromFile(modelPath);
  string vsPath = ASSET_PATH + SHADER_PATH + "/specularVS.glsl";
  string fsPath = ASSET_PATH + SHADER_PATH + "/specularFS.glsl";
    currentGameObject->loadShader(vsPath, fsPath);
    currentGameObject->setScale(vec3(0.45f, 0.45f, 0.45f));
    currentGameObject->setPosition(vec3(42.0f, 0.0f, 0.0f));
    
    currentGameObject->setRotationSpeed(vec3(0.0f, -1.0f, 0.0f));
    currentGameObject->setOrbitSpeed(vec3(0.0f, 2.5f, 0.0f));
    
    string texturePath = ASSET_PATH + TEXTURE_PATH + "/MarsColourMap2.png";
    currentGameObject->loadDiffuseMap(texturePath);
    
    gameObjects.push_back(currentGameObject);
}
Ejemplo n.º 3
0
void neptuneLoader()
{
    string modelPath = ASSET_PATH + MODEL_PATH + "/Planet.fbx";
    auto currentGameObject = loadFBXFromFile(modelPath);
    string vsPath = ASSET_PATH + SHADER_PATH + "/textureVS.glsl";
    string fsPath = ASSET_PATH + SHADER_PATH + "/textureFS.glsl";
    currentGameObject->loadShader(vsPath, fsPath);
    currentGameObject->setScale(vec3(0.9f, 0.9f, 0.9f));
    currentGameObject->setPosition(vec3(95.0f, 0.0f, 0.0f));
    
    currentGameObject->setRotationSpeed(vec3(0.0f, -1.0f, 0.0f));
    currentGameObject->setOrbitSpeed(vec3(0.0f, 0.78f, 0.0f));
    
    string texturePath = ASSET_PATH + TEXTURE_PATH + "/NeptuneColourMap.png";
    currentGameObject->loadDiffuseMap(texturePath);
    
    gameObjects.push_back(currentGameObject);
}
Ejemplo n.º 4
0
void earthLoader()
{
    string modelPath = ASSET_PATH + MODEL_PATH + "/Planet.fbx";
    auto currentGameObject = loadFBXFromFile(modelPath);
  string vsPath = ASSET_PATH + SHADER_PATH + "/specularVSTest.glsl";
  string fsPath = ASSET_PATH + SHADER_PATH + "/specularFSTest.glsl";
    currentGameObject->loadShader(vsPath, fsPath);
    currentGameObject->setScale(vec3(0.5f, 0.5f, 0.5f));

    currentGameObject->setPosition(vec3(35.0f, 0.0f, 0.0f));

    currentGameObject->setRotationSpeed(vec3(0.0f, -1.0f, 0.0f));
    currentGameObject->setOrbitSpeed(vec3(0.0f, 3.0f, 0.0f));

    string texturePath = ASSET_PATH + TEXTURE_PATH + "/EarthColourMap.png";
   string tecture2Path = ASSET_PATH + TEXTURE_PATH + "/EarthSpecMap.png";
    currentGameObject->loadDiffuseMap(texturePath);
     currentGameObject->LoadSpecularMap(tecture2Path);
  
    gameObjects.push_back(currentGameObject);
}