필터 지우기
필터 지우기

I want to change the color of the target object that I created with V_Real Builder every time it is repeated

조회 수: 1 (최근 30일)
clc;clear;close all
Myworld = vrworld('MyCicle1.x3d');
%%
open(Myworld);
%%
figMy = view(Myworld, '-internal');
vrdrawnow;
%%
GMy=get(Myworld)
%%
NMy=nodes(Myworld);
%% Accessing VRML Nodes
Cicle = vrnode(Myworld,'ObjectCicle');
%%
Cicle.translation = [0 0 0];
x1 = 1:15 ;
y1 = 0 + zeros(size(x1));
z1 = 0 + zeros(size(x1));
Ch=Myworld.ObjectCicle.children;
c1=getfield(Ch);
c2=getfield(c1.appearance);
c3=getfield(c2.material);
for i=1:length(x1)
Cicle.translation = [x1(i) y1(i) z1(i)];
c3.diffuseColor = rand(1,3);
vrdrawnow;
pause(1)
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by