I want to change the color of the target object that I created with V_Real Builder every time it is repeated
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Parallel Computing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!