0

リアクティブスクリプトの移行パッチに相当するものは何ですか? RGBA で 0,0,0,1 から 1,1,1,1 までの色をトゥイーンしたいと思います。次のように、単一の値をアルファとしてアニメーション化する方法を知っています。

const timeDriver = Animation.timeDriver(timeDriverParameters);
const alphaSampler = Animation.samplers.linear(1, 0);
const alphaAnimation = Animation.animate(timeDriver, alphaSampler);
mymaterial.opacity = alphaAnimation;

ビジュアル パッチを使用すると、トランスフォーム パッチを使用して、Vector3 をアニメーションの進行状況にリンクできます。リアクティブスクリプトのドキュメントのどこにもこのようなものは見つかりません。誰でも私に言うことができますか?

ありがとうございました!

4

1 に答える 1

2

ShaderModule を見る必要があります。名前でマテリアルを検索すると、setTexture を使用できます。


const R = require('Reactive');
const A = require('Animation');
const S = require('Shaders');
const Materials = require('Materials');


const material = Materials.get('matName');
const driver = A.timeDriver({ durationMilliseconds : 1000});
const sampler = A.samplers.linear(
    [1, 1, 1, 1],
    [0, 0, 0, 1]
);
const colorAnimation = A.animate(
    driver,
    sampler
);


material.setTexture(
    R.pack4(
        colorAnimation.get(0),
        colorAnimation.get(1),
        colorAnimation.get(2),
        colorAnimation.get(3)
    ), 
    {textureSlotName: S.DefaultMaterialTextures.DIFFUSE}
);  

ここでは ArrayOfScalarSamplers を使用しましたが、重要ではありません。

于 2020-01-10T15:16:44.910 に答える