≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Realtime Skybox Animation technique and weather tecnique...
Posted by:
(you are not logged in)
Enter the missing letter in: "In?ernational"
(you are not logged in)
Text:
[quote][b]just_in_case[/b] wrote: Hey guys am providing an example file which will Show/Guide you How to create a realtime skybox animation! our objective is to animate texture of skybox respective to time in our pc. instead of changing a texture i have used [b]make visible or invisible action[/b] for behaviour [b]if a variable has value do something[/b] Download the file and test it. It contains 3 different skyboxes [b]blue skybox,sunset and midnight skybox.[/b] blue skybox is the default skybox. To test the app. First set You pc's time to [b]1AM[/b] now test app. Set time to [b]5PM[/b] Now test app. Set time to [b]6AM[/b] test the app.(nothing will change unless its 5PM or 1AM in your pc's clock, because it is the default scene) you will find that how the skyboxes animate according to pc's time. there are also some 2d overlays which will draw realtime [b]CLOCK,DATE,MONTH,YEAR[/b] Here is the Code Also: [code]//implemented by Just_in_case. var date = new Date(); var seconds = date.getSeconds(); var minute = date.getMinutes(); var hour = (date.getHours()+ 24) % 12 || 12; var day = date.getDate(); var month = date.getMonth(); var year = date.getFullYear(); //Draw Time var s = ccbGetSceneNodeFromName("Time"); //change 'Time' with your 2d overlay name var text = ccbGetSceneNodeProperty(s, "Text"); ccbSetSceneNodeProperty(s, "Text",'Time:- '+date.getHours() +':'+date.getMinutes()+':'+date.getSeconds()); //Draw Date var s = ccbGetSceneNodeFromName("date"); //change 'date' with your 2d overlay name var text = ccbGetSceneNodeProperty(s, "Text"); ccbSetSceneNodeProperty(s, "Text",'Date:- '+date.getDate()); //Draw Month var s = ccbGetSceneNodeFromName("month"); //change 'month' with your 2d overlay name var text = ccbGetSceneNodeProperty(s, "Text"); ccbSetSceneNodeProperty(s, "Text",'Month:- '+date.getMonth()); //Draw Year var s = ccbGetSceneNodeFromName("year"); //change 'year' with your 2d overlay name var text = ccbGetSceneNodeProperty(s, "Text"); ccbSetSceneNodeProperty(s, "Text",'Year:- '+date.getFullYear()); //storing Variables ccbSetCopperCubeVariable("seconds",date.getSeconds() ); ccbSetCopperCubeVariable("minutes",date.getMinutes() ); ccbSetCopperCubeVariable("hours",date.getHours() ); ccbSetCopperCubeVariable("month",date.getMonth() ); ccbSetCopperCubeVariable("year",date.getFullYear() ); ccbSetCopperCubeVariable("date",date.getDate() ); [/code] For [b]Non-programmers[/b] Just add a new behaviour to your root scene node [b] every few seconds do something[/b] and then add a new action [b]Execute javascript[/b] and copy paste the above code there. Use variables [b]seconds,minutes,hours,year,date[/B] for your scene. for better understanding download the Example file: Download Link:- [b][url]https://drive.google.com/open?id=0By7Q7HWb1Z4KZnNIbFRYY0ZIQlU[/url][/b] Hope the example will help you. You can also animate weather according to month. and can create festivals in your game according to date. for example if it will 25th of December in real world then it will be Christmas in your game too. Thanks! Justin Case[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact