Home > @d_opvt > private > diva_drawman.m

diva_drawman

PURPOSE ^

DIVA_DRAWMAN Plots the DIVA character with the vocal tract

SYNOPSIS ^

function diva_drawman(P1,P2,jawh,AV,AVval,islast)

DESCRIPTION ^

 DIVA_DRAWMAN  Plots the DIVA character with the vocal tract
   Most of this code is taken from the older C code, with minor modifications.
   The function takes as input:
       P1,P2 - Plotting data returned from doAM
       jawh  - Jaw height parameter
       AV    - Voicing flag
       AVval - coordinates for plotting the sin voicing function
   The jaw jeight parameter is used to position the chin w.r.t. the head. This
   allows one to to show a fixed jaw position

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function diva_drawman(P1,P2,jawh,AV,AVval,islast)
0002 % DIVA_DRAWMAN  Plots the DIVA character with the vocal tract
0003 %   Most of this code is taken from the older C code, with minor modifications.
0004 %   The function takes as input:
0005 %       P1,P2 - Plotting data returned from doAM
0006 %       jawh  - Jaw height parameter
0007 %       AV    - Voicing flag
0008 %       AVval - coordinates for plotting the sin voicing function
0009 %   The jaw jeight parameter is used to position the chin w.r.t. the head. This
0010 %   allows one to to show a fixed jaw position
0011 
0012 % Satrajit Ghosh, SpeechLab, Boston University. (c)2001
0013 % $Header: /mnt/localhd/cvsdir/MODELLING/NEWDIVA/@d_opvt/private/diva_drawman.m,v 1.1.1.1 2006/10/06 18:20:23 brumberg Exp $
0014 
0015 % $NoKeywords: $
0016 
0017 % Setup globals
0018 global RELEASE
0019 
0020 if(nargin<6)
0021   islast=0;
0022 end
0023 
0024 % Check hold state of the axis
0025 if ishold,
0026     holdstate = 1;
0027 else,
0028     holdstate = 0;
0029     cla;
0030 end;
0031 
0032 hold on;
0033 
0034 %V = [140   450   140   650];
0035 %axis(V+[-50 +50 -50 +50]);
0036 
0037 eye_x = 315;
0038 
0039 %line([80 480],[80 680],'color','w');
0040 %rectangle('Position',[80 80 400 600],'Facecolor','w');
0041 
0042 line([25 600],[20 680],'color','w');
0043 rectangle('Position',[25 20 615 660],'Facecolor','w');
0044 
0045 xoffset=180;
0046 
0047 %/**** main part of head ****/
0048 line([280, 150]+xoffset,[425 425],'color','k');
0049 line([150, 150]+xoffset,[425 150],'color','k');
0050 line([150, 410]+xoffset,[150 150],'color','k');
0051 line([410, 410]+xoffset,[150 225],'color','k');
0052 
0053 %/* nose */
0054 line([410, 450]+xoffset,[225, 300],'color','k');
0055 line([450, 410]+xoffset,[300, 300],'color','k');
0056 line([410, 410]+xoffset,[300, 313],'color','k');
0057 
0058 %/**** hair on top of head ****/
0059 for i=150:5:410,
0060 %for i=150:5:280,
0061     line([i, (i + 5)]+xoffset,[140 150],'color','k');
0062 end;
0063 
0064 %/**** hair on back of head ****/
0065 for i=145:5:395,
0066     line([150, 140]+xoffset,[i, (i + 5)],'color','k');
0067 end;
0068 
0069 %/**** eye ****/
0070 %line([eye_x+5, eye_x+45],[200 200]);
0071 %line([eye_x+45, eye_x+45],[200 230]);
0072 %line([eye_x+45, eye_x+5],[230 230]);
0073 %line([eye_x+5, eye_x+5],[230 200]);
0074 
0075 rectangle('Position',[eye_x+5+xoffset,200,40,30],'Facecolor','w');
0076 rectangle('Position',[eye_x+25+xoffset, 215, 20, 15]);
0077 
0078 rectangle('Position',[eye_x+30+xoffset, 219, 12, 10],'Facecolor','k');
0079 
0080 %/**** hair on top of eye ****/
0081 for i=eye_x:5:eye_x+40,
0082     line([i, (i + 5)]+xoffset,[190 196],'color','k');
0083 end;
0084 
0085 %/**** body ****/
0086 rectangle('Position',[250+xoffset, 475, 100, 100]);
0087 
0088 if AV,
0089      line([275,325]+xoffset,[525,525],'color','k');
0090      line(AVval(:,1)+xoffset,AVval(:,2),'color','k');
0091 end;
0092 
0093 %/* legs */
0094 line([290, 250]+xoffset,[575 650],'color','k');
0095 line([250, 220]+xoffset,[650 650],'color','k');
0096 line([310, 350]+xoffset,[575 650],'color','k');
0097 line([350, 380]+xoffset,[650 650],'color','k');
0098 
0099 %/* arms */
0100 if(~islast)
0101   line([200, 250]+xoffset,[475 525],'color','k');
0102   line([400, 350]+xoffset,[475 525],'color','k');
0103 else
0104   line([200, 250]+xoffset,[575 525],'color','k');
0105   line([400, 350]+xoffset,[575 525],'color','k');
0106 end
0107 %/* neck */
0108 line([280, 280]+xoffset,[475 425],'color','k');
0109 line([320, 320]+xoffset,[475 425],'color','k');
0110 %/**************/
0111 
0112 x_off = 450;
0113 y_off =470;
0114 lsc = 10;
0115 ivtx = P1(1,:);
0116 ivty = P1(2,:);
0117 evtx = P1(3,:);
0118 evty = P1(4,:);
0119 
0120 %/********vocal tract***********/
0121 line(x_off-lsc*evtx+xoffset,y_off-lsc*evty,'color','k');
0122 line(x_off-lsc*ivtx+xoffset,y_off-lsc*ivty,'color','k');
0123 
0124 %/* upper lip */
0125 lip_x = evtx(length(evtx));
0126 lip_y = evty(length(evty));
0127 line([x_off-lsc*lip_x,x_off-lsc*lip_x]+xoffset,[y_off-lsc*lip_y,y_off-lsc*lip_y-6],'color','k');
0128 line([x_off-lsc*lip_x,410]+xoffset,[y_off-lsc*lip_y-6,y_off-lsc*lip_y-6],'color','k');
0129 
0130 %/* lower lip */
0131 lip_x = ivtx(length(ivtx));
0132 lip_y = ivty(length(ivty));
0133 line([x_off-lsc*lip_x,x_off-lsc*lip_x]+xoffset,[y_off-lsc*lip_y,y_off-lsc*lip_y+7],'color','k');
0134 line([x_off-lsc*lip_x,410]+xoffset,[y_off-lsc*lip_y+7,y_off-lsc*lip_y+7],'color','k');
0135 
0136 chin_y = 458.78 + (413.14 - 458.78)*(jawh + 3.0)/6.0;
0137 
0138 %/* jaw */
0139 
0140 %/* vertical line from bottom of lower lip to chin */
0141 line([410 410]+xoffset,[y_off-lsc*lip_y+7,chin_y],'color','k');
0142 
0143 %/* line joining chin to neck */
0144 line([410 320]+xoffset,[chin_y,425],'color','k');
0145 
0146 
0147 axis ij;
0148 
0149 % restore state
0150 if ~holdstate,
0151     hold off;
0152 end;

Generated on Tue 27-Mar-2007 12:06:24 by m2html © 2003