February 04, 2012, 04:08:51 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Creating a Day/Night Cycle?  (Read 1309 times)
gekido
Guest
« Reply #15 on: August 08, 2010, 08:15:36 PM »

gamecore doesn't like progressive jpeg's - just save them as standard jpegs and they will be fine.
Logged
tofugames
Newbie
*
Posts: 11



View Profile
« Reply #16 on: August 09, 2010, 01:41:41 AM »

Yeah, I got jpg's working now. Thanks Smiley

However I still have the weird texture problem. The texture looks right in Blender, Milkshape, Anim8or, and Photoshop; but in GC it gets messed for some reason.. Like in my earlier screenshot. I've been able to fix the weird lines appearing through my model by just making it a little 'thicker' so that is no longer a problem, but the texture is.. :/
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #17 on: August 09, 2010, 03:06:03 AM »

did you also change the far clip plane in the settings? The blackness is gamecore cutting away the model because it so far away. If you increase the far clip plane gamecore will "see" much furthere away in 3D Smiley
Logged
tofugames
Newbie
*
Posts: 11



View Profile
« Reply #18 on: August 09, 2010, 11:57:13 AM »

Yeah, I changed that also. Right now the only problem I seem to be having is the weird textures.. I have no idea why they get messed up in GC and look fine everywhere else..  Undecided
« Last Edit: August 09, 2010, 11:58:56 AM by tofugames » Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #19 on: August 09, 2010, 03:47:50 PM »

never seen that before. I have only had problem with textures not showing at all if missing etc but never looking weird if imported correctly. Don't really know what to recommend now
Logged
ross.rockafellow
Global Moderator
Full Member
*****
Posts: 142



View Profile
« Reply #20 on: August 10, 2010, 08:56:04 AM »

Maybe the scale is getting confused. Under the advanced tab in surface properties try changing the UV scale and see if that helps. If that still doesn't work post the object and the texture and I'll  test it here for you and see if I can figure it out.
Logged
tofugames
Newbie
*
Posts: 11



View Profile
« Reply #21 on: August 11, 2010, 05:51:07 PM »

Sorry for not replying, I haven't had internet for the past few days, or access to a computer  Tongue , but I am now trying what has been suggested, and if it doesn't work, I will upload the model.

EDIT: I got it working!  Grin I'm not sure what the problem was, but it was with blender. I switched to Wings3D and now it works perfectly! Smiley I just need to make it much bigger. So, now my question is this: How would I have the model change it's alpha value based on the time of day? Since my time of day value would constantly be rising (0.25 --> 0.5 --> 0.75 --> 1.0 --> 1.25 -->1.5 --> etc.) I'm not sure how to have it change based on the time of day.. Any help with this would be great! Smiley
   Thanks!  Cheesy
« Last Edit: August 12, 2010, 12:35:09 AM by tofugames » Logged
ross.rockafellow
Global Moderator
Full Member
*****
Posts: 142



View Profile
« Reply #22 on: August 12, 2010, 08:43:47 AM »

I don't know the code of hand, but you should be able to write a small custom script using time of day variables and applying it to the transparency of the surface. Some kind of if/else should work.

Here is a quick example. It's a script I worked on to control the luminosity of a surface, basically to make it pulse light:



//------------------------------------------------------------
//
//   Variable deceleration
//
//------------------------------------------------------------

float pulse;
String surfaceName;
String meshName;
ObjectMesh@ mesh;
bool upDown = false;
bool doPingPong = false;

//------------------------------------------------------------
//
//   void LoadControllerSettings( Object@ object)
//
//      Loads the controller settings from the object for this script. Usually called from Initialize(),
//      but also called from the game editor to determine which controller settings are required.
//
//   Parameters:
//
//      object - The object that this controller is to act upon.
//

void LoadControllerSettings( Object@ object)
{
   surfaceName = object.GetControllerSettingString("SurfaceName", surfaceName, "the name of the surface to pulse");
   meshName = object.GetControllerSettingString("MeshName", meshName, "the name of the mesh object with the pulsing surface");
   doPingPong = object.GetControllerSettingBool("PingPong", doPingPong, "Set to '1' to do a ping-pong pulse that transitions or '0' for a repeating linear pulse");
}

//------------------------------------------------------------
//
//   void Initialize( Object@ object)
//
//      This function is called when the controller is created.
//      Any initialization should be done here.
//
//   Parameters:
//
//      object - The object that this controller is to act upon.
//

void Initialize( Object@ object)
{
   LoadControllerSettings(object);
   @mesh = object.GetMesh(meshName);
   if (mesh == null)
      print("Invalid mesh for pulsing, please check meshName controller variable");
}




void AnimAdvance( Object@ object, float seconds, float interpAmount)
{
   // do our ping-pong pulsing
   if (doPingPong)
   {
      if (upDown)
      {
         pulse += seconds;
         if (pulse > 1)
            upDown = false;
      }
      else
      {
         pulse -= seconds;
         if (pulse < 0)
            upDown = true;
      }
   }
   else
   {
      // do normal linear pulse
      pulse += seconds;
      if (pulse > 1)
         pulse = 0;
   }
   
   //set the luminosity
   mesh.GetSurface(surfaceName).SetLuminosity(pulse);
   

}


The last line would be how you control the transparency just change it to:

mesh.GetSurface(surfaceName).SetTansparency(variable).

Hopefully that will get you started. Try to find a way to tie it to the time of day stuff. I'll give it a try when I find a little time too.

Good luck =)
Logged
tofugames
Newbie
*
Posts: 11



View Profile
« Reply #23 on: August 15, 2010, 12:32:21 AM »

Thanks ross.rockafellow! Cheesy I haven't had time to work on it lately due to school starting, but I should have time tomorrow. I'll see what I can come up with. Smiley

EDIT: Well, after a lot of tinkering, I haven't come up with much of anything..  Undecided I keep getting errors about having an invalid mesh on my model, and am still having trouble figuring out a way to work in the time of day variable..
« Last Edit: August 15, 2010, 05:30:47 PM by tofugames » Logged
Pages: 1 [2]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!