Water flow visible after a time
Hello,
The following js-code shows a water flow. It was also made with the HTML function.
$timeout(function() {
//$scope.setShader();
}, 1500);
$scope.setShader = function() {
$scope.view.wdg['3DImage-2']['shader'] = "textMove; time f 0.3";
$scope.view.wdg['3DImage-2']['src'] = "app/resources/Uploaded/Kalt_Pfeil.png?edge=repeat";
$scope.val=0;
$rootScope.$on('modelLoaded', function() {
$scope.setShader();
$interval(function() {
if($scope.val >50) $scope.val =0
else $scope.val +=1
$scope.view.wdg['3DImage-2']['shader'] = "textMove; time f " +$scope.val/-50 + ";"
console.info( "textMove; time f " +$scope.val/100 + ";")
}, 250)
And this code to visible the flow by click on a button:
$scope.buttonClick12 = function()
{
if ($scope.view.wdg['3DImage-2']['visible'] == true)
$scope.view.wdg['3DImage-2']['visible'] = false;
else
$scope.view.wdg['3DImage-2']['visible'] = true;
Now i want to do this like i click on the button the flow is visible first after for example 5 sec.
Then the flow is for example 3 sec visible and then automatically unvisible.
Is there any way to do this so?
Your help will be highly appreciated.
Thanks in advance.


