home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Corel Draw 7
/
CD7_CAD.ISO
/
cad
/
shade.csc
< prev
next >
Wrap
Text File
|
1996-10-28
|
10KB
|
331 lines
'This demonstration will demonstrate some of the SHADING options of CorelCAD
'************************************************************************************************************
'************************************************************************************************************
'************************************************************************************************************
'************************************************************************************************************
REM ⌐ 1996 Corel Corporation. All rights reserved.
'************************************************************************************************************
REM Declare Variables
Global Title as string
Rem Set Variable
Title$ = "CorelCAD: SHADE demonstration"
REM Declare Variables
DIM i%
DIM XCoord$
DIM XCoordNum%
DIM ShadeNum%
DIM ShadeType$(7)
DIM MatType1$(6)
DIM MatNum1%
DIM MatNum2%
DIM MetType$(4)
DIM CategoryType$(6)
DIM GlassType$(4)
DIM JewelType$(4)
DIM MinType$(4)
DIM PlasType$(4)
DIM WoodType$(4)
DIM ImageNum%
DIM Yes$
DIM YesNum%
DIM No$
DIM NoNum%
DIM FileName$
DIM FileNum%
Withobject "CorelCAD.Automation.1"
REM Call First Dialog and Open Chain Ring File
.FileOpen "..\cad\Shade.ccd"
.zoomtoall
STRING1$ = "This script will open a CorelCAD file and perform the SHADE command on the model within."
string2$ = "For more information on the SHADE command consult CorelCAD's On-line Help."
BEGIN DIALOG DispMessage 25, 70, 316, 75, Title$
TEXT 4, 4, 310, 12, String1$
TEXT 4, 18, 310, 10, String2$
TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
PUSHBUTTON 192, 44, 40, 16, "Next >>>"
CANCELBUTTON 240, 44, 40, 16
END DIALOG
Return% = DIALOG (DispMessage)
if Return = 2 then STOP
string1$ = "This model is a 3-Dimensional solid. "
string2$ = "A MATERIAL can be selected and applied to this model."
BEGIN DIALOG DispMessage1 25, 70, 316, 75, Title$
TEXT 4, 4, 310, 12, String1$
TEXT 4, 18, 310, 10, String2$
TEXT 4, 46, 170, 8, "Click NEXT to proceed or CANCEL to exit the Script."
PUSHBUTTON 192, 44, 40, 16, "Next >>>"
CANCELBUTTON 240, 44, 40, 16
END DIALOG
Return% = DIALOG (DispMessage1)
if Return = 2 then STOP
'RENDERING QUALITY
ShadeType(1) = "Flat Shading"
ShadeType(2) = "Gouraud Shading"
ShadeType(3) = "Phong Shading"
ShadeType(4) = "Preview"
ShadeType(5) = "Full Render"
ShadeType(6) = "Ray Traced Preview"
ShadeType(7) = "Ray Traced Render"
ShadeNum = 4
'DEFINING CATEGORY TYPES
MatType1(1) = "Metallic"
MatType1(2) = "Glass"
MatType1(3) = "Jewel"
MatType1(4) = "Mineral"
MatType1(5) = "Plastics"
MatType1(6) = "Woods"
MatNum1 = 4
'DEFINING THE MATERIAL
MatNum2 = 1
GlassType(1) = "Crystal Blue"
GlassType(2) = "Crystal Red"
GlassType(3) = "Glass Green"
GlassType(4) = "Glass Frosted"
JewelType(1) = "Sapphire"
JewelType(2) = "Ambrite"
JewelType(3) = "Ruby"
JewelType(4) = "Tiger's Eye"
MetType(1) = "Bronze"
MetType(2) = "Copper"
MetType(3) = "Chrome"
MetType(4) = "Steel"
MinType(1) = "Bricks"
MinType(2) = "Blue Marbel"
MinType(3) = "Granite"
MinType(4) = "Pavement"
PlasType(1) = "Bumpy Orange"
PlasType(2) = "Matte Black"
PlasType(3) = "Shiny Red"
PlasType(4) = "Clear Blue"
WoodType(1) = "Cedar"
WoodType(2) = "Mahogany"
WoodType(3) = "Oak"
WoodType(4) = "Pine"
' ************************************************************************************************
' ************************************************************************************************
' ************************************************************************************************
' ************************************************************************************************
START:
DONECOLORCHANGE:
BEGIN DIALOG StartDia 25, 70, 132, 114, "Material Selection"
LISTBOX 26, 26, 72, 56, MatType1$, MatNum1%
OKBUTTON 15, 94, 44, 14
CANCELBUTTON 61, 94, 44, 14
TEXT 8, 3, 122, 9, "Select Material Category."
GROUPBOX 20, 15, 84, 69, "Category Selection"
END DIALOG
Return = DIALOG(StartDia) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
If MatNum1 = 1 then
BEGIN DIALOG Matchange3 25, 70, 132, 115, "Material Selection"
LISTBOX 32, 36, 72, 48, MetType$, MatNum2%
OKBUTTON 12, 96, 48, 14
CANCELBUTTON 64, 96, 48, 14
TEXT 3, 8, 128, 12, "Select Material to be applied."
GROUPBOX 26, 24, 84, 64, "Metallic Types"
END DIALOG
Return = DIALOG(Matchange3) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case matnum2%
Case 1
.ApplyMaterial "Metallic", "Bronze"
Case 2
.ApplyMaterial "Metallic", "Copper"
Case 3
.ApplyMaterial "Metallic", "Chrome"
Case 4
.ApplyMaterial "Metallic", "Steel"
Case else
End Select
elseif MatNum1 = 2 then
BEGIN DIALOG Matchange1 25, 70, 132, 112, "Material Selection"
LISTBOX 32, 36, 72, 45, GlassType$, MatNum2%
OKBUTTON 12, 94, 48, 14
CANCELBUTTON 64, 94, 48, 14
TEXT 4, 8, 128, 12, "Select Material to be applied."
GROUPBOX 26, 24, 84, 63, "Glass Types"
END DIALOG
Return = DIALOG(Matchange1) 'Runs the dialog box
If Return = 2 then stop 'If the user presses ESC, cancels the script
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case MatNum2%
Case 1
.ApplyMaterial "Glass","Crystal Blue"
Case 2
.ApplyMaterial "Glass","Crystal Red"
Case 3
.ApplyMaterial "Glass","Glass Green"
Case 4
.ApplyMaterial "Glass","Glass Frosted"
End Select
elseif matnum1 = 3 then
BEGIN DIALOG Matchange2 25, 70, 130, 112, "Material Selection"
LISTBOX 32, 36, 72, 47, JewelType$, MatNum2%
OKBUTTON 13, 94, 48, 14
CANCELBUTTON 65, 94, 48, 14
TEXT 1, 8, 129, 10, "Select Material to be applied."
GROUPBOX 26, 24, 84, 64, "Jewel Types"
END DIALOG
Return = DIALOG(Matchange2) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case MatNum2%
Case 1
.ApplyMaterial "Jewel","Sapphire"
Case 2
.ApplyMaterial "Jewel","Ambrite"
Case 3
.ApplyMaterial "Jewel","Ruby"
Case 4
.ApplyMaterial "Jewel","Tiger's Eye"
End Select
elseif matnum1 =4 then
BEGIN DIALOG Matchange4 25, 70, 134, 112, "Material Selection"
LISTBOX 32, 36, 72, 48, MinType$, MatNum2%
OKBUTTON 16, 94, 48, 14
CANCELBUTTON 68, 94, 48, 14
TEXT 4, 8, 129, 12, "Select Material to be applied."
GROUPBOX 26, 25, 84, 64, "Mineral Types"
END DIALOG
Return = DIALOG(Matchange4) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case MatNum2%
Case 1
.ApplyMaterial "Mineral","Bricks"
Case 2
.ApplyMaterial "Mineral","Blue Marbel"
Case 3
.ApplyMaterial "Mineral","Granite"
Case 4
.ApplyMaterial "Mineral","Pavement"
End Select
elseif matnum1=5 then
BEGIN DIALOG Matchange5 25, 70, 132, 112, "Material Selection"
LISTBOX 32, 36, 72, 46, PlasType$, MatNum2%
OKBUTTON 14, 92, 48, 15
CANCELBUTTON 66, 92, 48, 15
TEXT 2, 8, 128, 12, "Select Material to be applied."
GROUPBOX 26, 24, 84, 60, "Plastic Types"
END DIALOG
Return = DIALOG(Matchange5) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case MatNum2%
Case 1
.ApplyMaterial "Plastics", "Bumpy Orange"
Case 2
.ApplyMaterial "Plastics", "Matte Black"
Case 3
.ApplyMaterial "Plastics", "Shiny Red"
Case 4
.ApplyMaterial "Plastics", "Clear Blue"
End Select
elseif matnum1 = 6 then
BEGIN DIALOG Matchange6 25, 70, 130, 112, "Material Selection"
LISTBOX 32, 36, 72, 48, WoodType$, MatNum2%
OKBUTTON 16, 95, 48, 13
CANCELBUTTON 68, 95, 48, 13
TEXT 2, 8, 128, 12, "Select Material to be applied."
GROUPBOX 26, 24, 84, 65, "Wood Types"
END DIALOG
Return = DIALOG(Matchange6) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the scrip
.SelectAll 'Selects the object to apply the Shading or Material.
Select Case MatNum2%
Case 1
.ApplyMaterial "Woods", "Cedar"
Case 2
.ApplyMaterial "Woods", "Mahogany"
Case 3
.ApplyMaterial "Woods", "Oak"
Case 4
.ApplyMaterial "Woods", "Pine"
End Select
Endif
BEGIN DIALOG Shade 25, 70, 126, 145, "Rendering Quality"
LISTBOX 26, 26, 72, 56, ShadeType$, ShadeNum%
OKBUTTON 14, 124, 44, 15
CANCELBUTTON 60, 124, 44, 15
TEXT 8, 3, 118, 9, "Select Render Quality:"
GROUPBOX 20, 15, 84, 69, "Render Quality"
TEXT 16, 89, 97, 34, "The RENDER types are listed in increasing RENDER quality. A high quality RENDER may take a moment."
END DIALOG
Return = DIALOG(Shade) 'Runs the dialog box
If return = 2 then stop 'If the user presses ESC, cancels the script
ShadeNum = ShadeNum - 1
.ShadeEntireView 0,0,ShadeNum,0
String1$ = "The SHADE PROPERTIES dialog box can be opened by right-mouse clicking on the SHADE button."
String2$ = "Lighting, shadows, and render options are all available in the SHADE PROPERTIES dialog box."
beep
BEGIN DIALOG EndMess 25, 70, 316, 75, "FINAL HINTS"
TEXT 4, 4, 310, 16, String1$
TEXT 4, 25, 310, 17, String2$
TEXT 42, 48, 118, 8, "Click END to finish the demonstation."
PUSHBUTTON 223, 47, 40, 16, "END"
END DIALOG
ret = DIALOG(EndMess)
END WITHOBJECT