cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

blinking of a 3d image

potatochips
14-Alexandrite

blinking of a 3d image

How to create a 3d image that is blinking?

ACCEPTED SOLUTION

Accepted Solutions

You would probably need to use an $interval timer for this, along these lines:

$scope.blinkInterval = 0;

$scope.blinkImage = function(id) {
    var current = $scope.view.wdg[id].visible;
    if (current == undefined) { current = true;}
    $scope.setWidgetProp(id, "visible", !current);
}

$scope.startBlink = function() {
    $scope.blinkInterval = $interval($scope.blinkImage, 1000, 0, true, "3DImage-1");
}

$scope.stopBlink = function(id) {
  $interval.cancel($scope.blinkInterval);
}

angular.element(document).ready($scope.startBlink);

You can use the $scope.stopBlink() function to stop the image from blinking, either in response to an event or attached to a UI control if you want.

If you want to control when the blinking starts, simply remove the last line and add a call to $scope.startBlink() when you want it to start blinking.

View solution in original post

1 REPLY 1

You would probably need to use an $interval timer for this, along these lines:

$scope.blinkInterval = 0;

$scope.blinkImage = function(id) {
    var current = $scope.view.wdg[id].visible;
    if (current == undefined) { current = true;}
    $scope.setWidgetProp(id, "visible", !current);
}

$scope.startBlink = function() {
    $scope.blinkInterval = $interval($scope.blinkImage, 1000, 0, true, "3DImage-1");
}

$scope.stopBlink = function(id) {
  $interval.cancel($scope.blinkInterval);
}

angular.element(document).ready($scope.startBlink);

You can use the $scope.stopBlink() function to stop the image from blinking, either in response to an event or attached to a UI control if you want.

If you want to control when the blinking starts, simply remove the last line and add a call to $scope.startBlink() when you want it to start blinking.

Announcements

Top Tags