Escolar Documentos
Profissional Documentos
Cultura Documentos
RESEARCH PAPER
Prof. Ram Meghe Institute of Technology & Research, Amravati, Maharashtra, INDIA.
*Corresponding Author’s Email ID: dipakshirbhate@gmail.com
ABSTRACT
VRML is an international standard of 3D representation on web. This paper describes how Matlab’s Simulink capabilities can be used
to control various parameters of VRML 3D objects such as speed, light intensity, color, transparency etc. of a complex Grain Cleaning
system.
Keywords: GUI (Graphic User Interface), VRML (Virtual Reality Modelling Language).
V2.0/part1/javascript.html. This format includes a The Simulink 3D Animation server ignores the VRML
description of 3-D scenes, sounds, internal actions, and Script node, but it passes the node to the VRML Viewer.
WWW anchors. Passing the node allows you to run VRML scripts on the
viewer side. You cannot run them on the Simulink 3D
The software analyzes the structure of the virtual world, Animation server.
determines what signals are available, and makes them
available from the MATLAB® and Simulink In keeping with the VRML97 specification, the Simulink
environment. 3D Animation Viewer ignores BMP files. As a result,
VRML scene textures sometimes display improperly in
Simulink 3D Animation software ensures that the the Simulink 3D Animation Viewer. To display scene
changes made to a virtual world are reflected in the textures properly, replace all BMP texture files in a
MATLAB and Simulink interfaces. If you change the VRML scene with PNG, JPG, or GIF equivalents.
viewpoint in your virtual world, this change occurs in
thevrworld object properties in MATLAB and Simulink
interfaces. 5. METHODOLOGY
To check the capability, it was decided to develop a
The software includes functions for retrieving and demo program using MATLAB’s Simulink GUI. The
changing virtual world properties. objective was to vary speed of helical gears rotating in
two different directions.
4. VRML COMPATIBILITY Below is the screen shot of helical gear assembly model
The Simulink 3D Animation product currently supports viewed in Virtual Environment using BS contact player.
most features of VRML97, with the following
limitations:
We can open the same model in MATLAB’s V- Realm geometrical object contains an independent “geometry”
builder to see various nodes as shown in figure below. In node and “appearance” node. The geometry node
the VRML file format, a 3D virtual world scene is controls the size and shape of each part. Whereas, the
described by a hierarchical tree structure of several appearance node controls the texture and material
objects. These objects are called “nodes”. A node may properties. The “appearance” node specifies the
contain other nodes (child nodes) under it. When a new physical properties such as the color, shininess,
node is created, the required fields are automatically transparency etc. The material properties of each sub-
generated and filled with default values. These fields part can be controlled independently. However, for
hold the data for each node. In VRML, every grouping the parts which have the same material
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 243
properties the VRML “USE” node is used. The “USE” Emissive color is useful for displaying radiosity based
node repeats the same material properties on any other models.
object in the model. It is better to set some materials at
the start and then use these as and when required. The (d) Shininess. The “shininess” specifies how well a
following are the material fields used in VRML. surface is polished. Shininess values range from 0.0 for
dull surface to 1.0 for a highly polished surface.
(a) Ambient Intensity. The “ambient Intensity” specifies
the amount of ambient light the surface should reflect. (e) Specular Colour. The “specular Color” represents
Ambient intensity can be represented as any scalar value the colour of the highlights on a highly reflected object.
between 0.0 to 1.0 both inclusive. The higher the value This is the colour of the light that reflects directly back
the higher the reflection. to the viewer.
(b) Diffused Colour. The “diffuse Color” field indicates (f) Transparency. The “transparency” field specifies the
more or less the color of light that reflects/scatters most transmittance of an object, ranging from 0.0 for
from the object. The diffused color is specified in RGB completely opaque to 1.0 for a completely clear surface.
(red, green and blue) colour. Any value in between may represent a semi-transparent
object.
(c) Emissive Colour. The “emissive Color” field
specifies the light produced by a glowing object.
The entire MATLAB code to control helical gears model parameters is as follows
global tv1 ;
tv1 = 0 ;
global flg_light ;
flg_light = 0 ;
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 244
global flg_hlight ;
flg_hlight = 0 ;
s1 = uicontrol('Style','slider','Callback', {@s1_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.8 0.5 .08],'Max',15,...
'Min',0,'SliderStep',[0.01 0.10]);
sv1 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.8 0.2 .09],'BackgroundColor','w');
s2 = uicontrol('Style','slider','Callback', {@s2_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.7 0.5 .08],'Max',15,...
'Min',0,'SliderStep',[0.01 0.10]);
sv2 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.7 0.2 .09],'BackgroundColor','w');
s3 = uicontrol('Style','slider','Callback', {@s3_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.6 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv3 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.6 0.2 .09],'BackgroundColor','w');
sv3l = uicontrol(gcf,'Style','text','FontSize',12,'String','',...
'Units','normalized','Position',[0.8 0.6 0.2 .09]);
s4 = uicontrol('Style','slider','Callback', {@s4_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.5 0.5 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
sv4 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.5 0.2 .09],'BackgroundColor','w');
sv4l = uicontrol(gcf,'Style','text','FontSize',12,'String','transp-cy',...
'Units','normalized','Position',[0.8 0.5 0.2 .09]);
s5 = uicontrol('Style','slider','Callback', {@s5_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.4 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv5 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.4 0.2 .09],'BackgroundColor','w');
s6 = uicontrol('Style','slider','Callback', {@s6_callback},'FontSize',14,...
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 245
sv6 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.3 0.2 .09],'BackgroundColor','w');
start_wrl = uicontrol('String','start','Callback',
{@start_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.18 0.15 .1]);
stop_wrl = uicontrol('String','stop','Callback',
{@stop_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.06 0.15 .1]);
light_wrl = uicontrol('String','light','Callback',
{@light_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.18 0.15 .1]);
hlight_wrl = uicontrol('String','hlight','Callback',
{@hlight_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.06 0.15 .1]);
t = timer('period',0.02);
set(t,'ExecutionMode','fixedrate','StartDelay',0.5);
set(t,'timerfcn',@mytimer_callback);
% start(t);
tg41 = vrnode(myw,'group04-TIMER');
tg51 = vrnode(myw,'group05-TIMER');
light1 = vrnode(myw,'Light');
sun1 = vrnode(myw,'sun');
axis off;
% [X> B^ W H]
function s1_callback(hObject,eventdata)
T1=get(s1,'value');
set(sv1,'string',15-T1)
tg51.cycleInterval = T1;
end
function s2_callback(hObject,eventdata)
T1=get(s2,'value');
set(sv2,'string',15-T1)
tg41.cycleInterval = T1;
% myw = vrworld('HELICAL GEAR .wrl');
% open(myw)
% view(myw)
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 246
end
function s3_callback(hObject,eventdata)
T1=get(s3,'value');
set(sv3,'string',T1)
% myw = vrworld('HELICAL GEAR .wrl');
% open(myw)
% view(myw)
end
function s4_callback(hObject,eventdata)
T1=get(s4,'value');
set(sv4,'string',T1)
myw.VIFS476.children.appearance.material.transparency=T1
end
function s5_callback(hObject,eventdata)
T1=get(s5,'value');
set(sv5,'string',T1)
light1.intensity = T1;
end
function s6_callback(hObject,eventdata)
T1=get(s6,'value');
set(sv6,'string',T1)
sun1.intensity = T1;
% myw = vrworld('HELICAL GEAR .wrl');
% open(myw)
% view(myw)
end
function start_wrl_callback(hObject,eventdata)
start(t);
end
function stop_wrl_callback(hObject,eventdata)
stop(t);
end
function light_wrl_callback(hObject,eventdata)
if (flg_light == 0)
set(f,'Lighting','off')
flg_light = 1 ;
else
set(f,'Lighting','on')
flg_light = 0 ;
end
end
function hlight_wrl_callback(hObject,eventdata)
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 247
if (flg_hlight == 0)
set(f,'Headlight','off')
flg_hlight = 1 ;
else
set(f,'Headlight','on')
flg_hlight = 0 ;
end
%%
end
function mytimer_callback(hObject,eventdata)
end
%%
function my_closereq(hObject,eventdata)
delete(timerfind)
close(myw);
delete(myw);
delete(gcf);
end
end
(1) Speed (w1), (2) Speed (w2) (3) Transparency (4) Light Intensity (5) Sun Light Intensity
Fig 3. Graphic user interface 1 to control VRML helical gears model parameters using Simulink
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 248
Fig 4. Graphic user interface 2 to control VRML grain cleaning system parameters using Simulink
function gui2()
clc
global tv1 ;
tv1 = 0 ;
global flg_light ;
flg_light = 0 ;
global flg_hlight ;
flg_hlight = 0 ;
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 249
s1 = uicontrol('Style','slider','Callback', {@s1_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.8 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv1 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.8 0.2 .09],'BackgroundColor','w');
sv1l = uicontrol(gcf,'Style','text','FontSize',12,'String','speed',...
'Units','normalized','Position',[0.8 0.8 0.2 .09]);
s2 = uicontrol('Style','slider','Callback', {@s2_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.7 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv2 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.7 0.2 .09],'BackgroundColor','w');
sv2l = uicontrol(gcf,'Style','text','FontSize',12,'String','',...
'Units','normalized','Position',[0.8 0.7 0.2 .09]);
s3 = uicontrol('Style','slider','Callback', {@s3_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.6 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv3 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.6 0.2 .09],'BackgroundColor','w');
sv3l = uicontrol(gcf,'Style','text','FontSize',12,'String','',...
'Units','normalized','Position',[0.8 0.6 0.2 .09]);
s4 = uicontrol('Style','slider','Callback', {@s4_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.5 0.5 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
sv4 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.5 0.2 .09],'BackgroundColor','w');
sv4l = uicontrol(gcf,'Style','text','FontSize',12,'String','transp-cy',...
'Units','normalized','Position',[0.8 0.5 0.2 .09]);
s5 = uicontrol('Style','slider','Callback', {@s5_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.4 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv5 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.4 0.2 .09],'BackgroundColor','w');
s6 = uicontrol('Style','slider','Callback', {@s6_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.3 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv6 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 250
start_wrl = uicontrol('String','start','Callback',
{@start_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.18 0.15 .1]);
stop_wrl = uicontrol('String','stop','Callback',
{@stop_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.06 0.15 .1]);
light_wrl = uicontrol('String','light','Callback',
{@light_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.18 0.15 .1]);
hlight_wrl = uicontrol('String','hlight','Callback',
{@hlight_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.06 0.15 .1]);
t = timer('period',0.02);
set(t,'ExecutionMode','fixedrate','StartDelay',0.5);
set(t,'timerfcn',@mytimer_callback);
% start(t);
myw = vrworld('FC1.wrl');
% myw = vrworld('HELICAL GEAR .wrl');
open(myw)
f = vrfigure(myw);
% tg41 = vrnode(myw,'group04-TIMER');
% tg51 = vrnode(myw,'group05-TIMER');
light1 = vrnode(myw,'light');
sun1 = vrnode(myw,'sun');
axis off;
% [X> B^ W H]
function s1_callback(hObject,eventdata)
T1=get(s1,'value');
set(sv1,'string',T1)
tg41.cycleInterval = T1;
end
function s2_callback(hObject,eventdata)
T1=get(s2,'value');
set(sv2,'string',T1)
tg51.cycleInterval = T1;
end
function s3_callback(hObject,eventdata)
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 251
T1=get(s3,'value');
set(sv3,'string',T1)
end
function s4_callback(hObject,eventdata)
T1=get(s4,'value');
set(sv4,'string',T1)
myw.Elev_box_01.children.appearance.material.transparency=T1;
myw.Elev_box_0.children.appearance.material.transparency=T1;
myw.Elev_box.children.appearance.material.transparency=T1;
end
function s5_callback(hObject,eventdata)
T1=get(s5,'value');
set(sv5,'string',T1)
light1.intensity = T1;
end
function s6_callback(hObject,eventdata)
T1=get(s6,'value');
set(sv6,'string',T1)
sun1.intensity = T1;
end
function start_wrl_callback(hObject,eventdata)
start(t);
end
function stop_wrl_callback(hObject,eventdata)
stop(t);
end
function light_wrl_callback(hObject,eventdata)
if (flg_light == 0)
set(f,'Lighting','off')
flg_light = 1 ;
else
set(f,'Lighting','on')
flg_light = 0 ;
end
end
function hlight_wrl_callback(hObject,eventdata)
if (flg_hlight == 0)
set(f,'Headlight','off')
flg_hlight = 1 ;
else
set(f,'Headlight','on')
flg_hlight = 0 ;
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 252
end
%%
end
function mytimer_callback(hObject,eventdata)
end
%%
function my_closereq(hObject,eventdata)
delete(timerfind)
close(myw);
delete(myw);
delete(gcf);
end
end
Fig 5. Graphic user interface 3 to control VRML grain cleaning system parameters using Simulink (with GUI
extended to control color RGB values)
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 253
function gui3()
clc
global tv1 ;
tv1 = 0 ;
global flg_light ;
flg_light = 0 ;
global flg_hlight ;
flg_hlight = 0 ;
global a11;
global b11;
s0 = uicontrol('Style','slider','Callback', {@s0_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.9 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv0 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.9 0.2 .09],'BackgroundColor','w');
sv00 = uicontrol(gcf,'Style','text','FontSize',12,'String','speed',...
'Units','normalized','Position',[0.8 0.9 0.2 .09]);
s1 = uicontrol('Style','slider','Callback', {@s1_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.8 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv1 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.8 0.2 .09],'BackgroundColor','w');
sv1l = uicontrol(gcf,'Style','text','FontSize',10,'String','S01-TIMER',...
'Units','normalized','Position',[0.8 0.8 0.2 .09]);
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 254
s2 = uicontrol('Style','slider','Callback', {@s2_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.7 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv2 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.7 0.2 .09],'BackgroundColor','w');
sv2l = uicontrol(gcf,'Style','text','FontSize',10,'String','Dis01-TIMER',...
'Units','normalized','Position',[0.8 0.7 0.2 .09]);
s3 = uicontrol('Style','slider','Callback', {@s3_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.6 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv3 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.6 0.2 .09],'BackgroundColor','w');
sv3l = uicontrol(gcf,'Style','text','FontSize',10,'String','belt-TIMER',...
'Units','normalized','Position',[0.8 0.6 0.2 .09]);
s4 = uicontrol('Style','slider','Callback', {@s4_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.5 0.5 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
sv4 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.5 0.2 .09],'BackgroundColor','w');
sv4l = uicontrol(gcf,'Style','text','FontSize',12,'String','transp-cy',...
'Units','normalized','Position',[0.8 0.5 0.2 .09]);
s5 = uicontrol('Style','slider','Callback', {@s5_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.4 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv5 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.4 0.2 .09],'BackgroundColor','w');
s6 = uicontrol('Style','slider','Callback', {@s6_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.3 0.5 .08],'Max',10,...
'Min',0,'SliderStep',[0.01 0.10]);
sv6 = uicontrol(gcf,'Style','edit','FontSize',12,'String','',...
'Units','normalized','Position',[0.6 0.3 0.2 .09],'BackgroundColor','w');
start_wrl = uicontrol('String','start','Callback',
{@start_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.18 0.15 .1]);
stop_wrl = uicontrol('String','stop','Callback',
{@stop_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.1 0.06 0.15 .1]);
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 255
light_wrl = uicontrol('String','light','Callback',
{@light_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.18 0.15 .1]);
hlight_wrl = uicontrol('String','hlight','Callback',
{@hlight_wrl_callback},'FontSize',14,...
'Units','normalized','Position',[0.3 0.06 0.15 .1]);
r1 = uicontrol('Style','slider','Callback', {@rgb_callback},'FontSize',14,...
'Units','normalized','Position',[0.6 0.2 0.4 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
r1l = uicontrol(gcf,'Style','text','FontSize',12,'String','R',...
'Units','normalized','Position',[0.53 0.215 0.06 .06]);
g1 = uicontrol('Style','slider','Callback', {@rgb_callback},'FontSize',14,...
'Units','normalized','Position',[0.6 0.11 0.4 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
g1l = uicontrol(gcf,'Style','text','FontSize',12,'String','G',...
'Units','normalized','Position',[0.53 0.118 0.06 .06]);
b1 = uicontrol('Style','slider','Callback', {@rgb_callback},'FontSize',14,...
'Units','normalized','Position',[0.6 0.01 0.4 .08],'Max',1,...
'Min',0,'SliderStep',[0.01 0.10]);
b1l = uicontrol(gcf,'Style','text','FontSize',12,'String','B',...
'Units','normalized','Position',[0.53 0.018 0.06 .06]);
t = timer('period',0.02);
set(t,'ExecutionMode','fixedrate','StartDelay',0.5);
set(t,'timerfcn',@mytimer_callback);
% start(t);
flg=1;
if (flg==1)
myw = vrworld('FF1.wrl');
% myw = vrworld('HELICAL GEAR .wrl');
open(myw)
f = vrfigure(myw);
tg1 = vrnode(myw,'Seprator01-TIMER');
tg2 = vrnode(myw,'Distoner01-TIMER');
tg3 = vrnode(myw,'belt_conveyer-TIMER');
tg4 = vrnode(myw,'belt_conveyer_0-TIMER');
% Seprator01-TIMER (TimeSensor) []
% Distoner01-TIMER (TimeSensor) []
% belt_conveyer-TIMER (TimeSensor) []
% belt_conveyer_0-TIMER (Transform) []
light1 = vrnode(myw,'light');
sun1 = vrnode(myw,'sun');
t2=vrnode(myw,'Layer:BRUSH');
r4=t2.children;
q11=r4(1,2).appearance(1,1);
a11=q11.material(1,1);
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 256
% a11(1,1).transparency=0.8
% a11(1,1).transparency=0.0
w2=vrnode(myw,'machine');
ww4=w2.children;
we=ww4(1,1).appearance(1,1);
b11=we.material(1,1);
% b11(1,1).transparency=0.1
end
axis off;
% [X> B^ W H]
function s0_callback(hObject,eventdata)
T1=get(s0,'value');
set(sv0,'string',T1)
tg1.cycleInterval = T1;
end
function s1_callback(hObject,eventdata)
T1=get(s1,'value');
set(sv1,'string',T1)
tg2.cycleInterval = T1;
end
function s2_callback(hObject,eventdata)
T1=get(s2,'value');
set(sv2,'string',T1)
tg3.cycleInterval = T1;
end
function s3_callback(hObject,eventdata)
T1=get(s3,'value');
set(sv3,'string',T1)
tg4.cycleInterval = T1;
end
function s4_callback(hObject,eventdata)
T1=get(s4,'value');
set(sv4,'string',T1)
% myw.Elev_box_01.children.appearance.material.transparency=T1;
sa1=vrnode(myw,'Elev_box_01');
sa2=sa1.children;
sa3=sa2(1,1).appearance(1,1);
sa4=sa3.material(1,1);
sa4(1,1).transparency=T1;
sa1=vrnode(myw,'Elev_box_0');
sa2=sa1.children;
sa3=sa2(1,1).appearance(1,1);
sa4=sa3.material(1,1);
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 257
sa4(1,1).transparency=T1;
sa1=vrnode(myw,'Elev_box');
sa2=sa1.children;
sa3=sa2(1,1).appearance(1,1);
sa4=sa3.material(1,1);
sa4(1,1).transparency=T1;
% myw.Elev_box_0.children.appearance.material.transparency=T1;
% myw.Elev_box.children.appearance.material.transparency=T1;
a11(1,1).transparency=T1;
b11(1,1).transparency=T1;
end
function s5_callback(hObject,eventdata)
T1=get(s5,'value');
set(sv5,'string',T1)
light1.intensity = T1;
end
function s6_callback(hObject,eventdata)
T1=get(s6,'value');
set(sv6,'string',T1)
sun1.intensity = T1;
end
function start_wrl_callback(hObject,eventdata)
start(t);
end
function stop_wrl_callback(hObject,eventdata)
stop(t);
end
function light_wrl_callback(hObject,eventdata)
if (flg_light == 0)
set(f,'Lighting','off')
flg_light = 1 ;
else
set(f,'Lighting','on')
flg_light = 0 ;
end
end
function hlight_wrl_callback(hObject,eventdata)
if (flg_hlight == 0)
set(f,'Headlight','off')
flg_hlight = 1 ;
else
set(f,'Headlight','on')
flg_hlight = 0 ;
Dipak Vinayak Shirbhate and Dilip Sahebrao Ingole VSRDIJMCAPE, Vol. VII (IX) September 2017 / 258
end
end
function mytimer_callback(hObject,eventdata)
end
function rgb_callback(hObject,eventdata)
r11=get(r1,'value');
g11=get(g1,'value');
b11=get(b1,'value');
end
%%
function my_closereq(hObject,eventdata)
delete(timerfind)
if(flg==1)
close(myw);
% delete(myw);
end
delete(gcf);
end
end
In future rotation of objects (about X, Y and Z axis) and their relative positions can be controlled if required. A GUI can
be developed to control complex VRML world objects build by calling objects sequentially in a scene.
11.REFERENCES
[1] Virtual Reality tool box for use with for Use with MATLAB® and Simulink® developed by Math Work User’s Guide Version 4
[2] Virtual Laboratories Using Simulink: A Pilot Study by Dr. Mark David Bedillion, South Dakota School of Mines and Technology
and Mr. Mohamed Hakeem Mohamed Nizar, South Dakota School of Mines & Technology: Department of Mechanical
Engineering, 122nd ASEE Annual Conference and Exposition, June 14-17, 2015
[3] Using DIS (Distributed Interactive Simulation) for linking Simulation and Animation in Simulink and VRML