Skip to content

Commit

Permalink
1.0.06.002 01/20/2018
Browse files Browse the repository at this point in the history
1. A Ring Phase property was added, to allow more complex twisting
effects.
2. A Ruffle oscillator was added to the Bend effect; it phase modulates
the Bend oscillator to create wavy ripples.
3. Optional auto-zoom was added to the auto-rotate effect.
  • Loading branch information
victimofleisure committed Jan 21, 2018
1 parent 2caaf0c commit 7a43b72
Show file tree
Hide file tree
Showing 15 changed files with 668 additions and 477 deletions.
Binary file modified PotterDraw.chm
Binary file not shown.
365 changes: 188 additions & 177 deletions PotterDraw/HelpIDs.h

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions PotterDraw/HelpResMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{IDS_PDR_NAME_fRadius, IDH_Properties_Mesh_Radius},
{IDS_PDR_NAME_fWallThickness, IDH_Properties_Mesh_Wall_Thickness},
{IDS_PDR_NAME_fTwist, IDH_Properties_Mesh_Twist},
{IDS_PDR_NAME_fRingPhase, IDH_Properties_Mesh_Ring_Phase},
{IDS_PDR_NAME_fAspectRatio, IDH_Properties_Mesh_Aspect_Ratio},
{IDS_PDR_NAME_fPolygonSides, IDH_Properties_Mesh_Polygon_Polygon_Sides},
{IDS_PDR_NAME_fPolygonRoundness, IDH_Properties_Mesh_Polygon_Polygon_Roundness},
Expand Down Expand Up @@ -51,6 +52,15 @@
{IDS_PDR_NAME_iBendOperation, IDH_Properties_Mesh_Bend_Bend_Operation},
{IDS_PDR_NAME_fBendPower, IDH_Properties_Mesh_Bend_Bend_Power},
{IDS_PDR_NAME_iBendPowerType, IDH_Properties_Mesh_Bend_Bend_Power_Type},
{IDS_PDR_NAME_fRuffles, IDH_Properties_Mesh_Bend_Ruffle_Ruffles},
{IDS_PDR_NAME_fRuffleDepth, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Depth},
{IDS_PDR_NAME_fRufflePhase, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Phase},
{IDS_PDR_NAME_iRuffleWaveform, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Waveform},
{IDS_PDR_NAME_iRuffleMotif, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Motif},
{IDS_PDR_NAME_fRufflePower, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Power},
{IDS_PDR_NAME_iRufflePowerType, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Power_Type},
{IDS_PDR_NAME_fRufflePulseWidth, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Pulse_Width},
{IDS_PDR_NAME_fRuffleSlew, IDH_Properties_Mesh_Bend_Ruffle_Ruffle_Slew},
{IDS_PDR_NAME_fHelixFrequency, IDH_Properties_Mesh_Helix_Helix_Frequency},
{IDS_PDR_NAME_fHelixAmplitude, IDH_Properties_Mesh_Helix_Helix_Amplitude},
{IDS_PDR_NAME_sTexturePath, IDH_Properties_Texture_Texture_Path},
Expand All @@ -68,11 +78,12 @@
{IDS_PDR_NAME_fCyclesV, IDH_Properties_Texture_Cycles_V},
{IDS_PDR_NAME_fEdgeGain, IDH_Properties_Texture_Edge_Gain},
{IDS_PDR_NAME_bAnimation, IDH_Properties_View_Animation},
{IDS_PDR_NAME_fAutoRotateYaw, IDH_Properties_View_Auto_Rotate_Yaw},
{IDS_PDR_NAME_fAutoRotatePitch, IDH_Properties_View_Auto_Rotate_Pitch},
{IDS_PDR_NAME_fAutoRotateRoll, IDH_Properties_View_Auto_Rotate_Roll},
{IDS_PDR_NAME_fFrameRate, IDH_Properties_View_Frame_Rate},
{IDS_PDR_NAME_clrBackground, IDH_Properties_View_Background_Color},
{IDS_PDR_NAME_fAutoRotateYaw, IDH_Properties_View_Auto_Rotate_Auto_Rotate_Yaw},
{IDS_PDR_NAME_fAutoRotatePitch, IDH_Properties_View_Auto_Rotate_Auto_Rotate_Pitch},
{IDS_PDR_NAME_fAutoRotateRoll, IDH_Properties_View_Auto_Rotate_Auto_Rotate_Roll},
{IDS_PDR_NAME_fAutoRotateZoom, IDH_Properties_View_Auto_Rotate_Auto_Rotate_Zoom},
{IDS_MOD_NAME_iTarget, IDH_Modulation_Target},
{IDS_MOD_NAME_iWaveform, IDH_Modulation_Waveform},
{IDS_MOD_NAME_iOperation, IDH_Modulation_Operation},
Expand Down
3 changes: 2 additions & 1 deletion PotterDraw/ModulationProps.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
01 03nov17 add property subgroup
02 10nov17 add power types
03 24nov17 add animated modulation accessor
04 03jan18 change target enum's prefix to avoid conflicts
*/

Expand All @@ -33,7 +34,7 @@ class CModulationProps : public CProperties {
GROUPS
};
enum { // targets
#define PROPDEF(group, subgroup, proptype, type, name, initval, minval, maxval, itemname, items) PROP_##name,
#define PROPDEF(group, subgroup, proptype, type, name, initval, minval, maxval, itemname, items) TARG_##name,
#include "PotPropsDef.h"
TARGETS
};
Expand Down
18 changes: 15 additions & 3 deletions PotterDraw/PotGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
24 12dec17 add operation, power and power type to ripple and bend
25 12dec17 in SetViewState, set standard view if applicable
26 15dec17 add edges color pattern
27 02jan18 add ruffle properties
28 03jan18 add ring phase
*/

Expand Down Expand Up @@ -347,6 +349,7 @@ void CPotGraphics::CalcPotMesh()
bool bHasScallops = HasScallops();
bool bHasRipples = HasRipples();
bool bHasBends = HasBends();
bool bHasRuffles = HasRuffles();
bool bHasHelix = HasHelix();
bool bIsPolygon = IsPolygon();
double fRingBend = 0;
Expand Down Expand Up @@ -386,13 +389,13 @@ void CPotGraphics::CalcPotMesh()
else // operation is exponentiate
fRad *= pow(2, r);
}
if (bHasBends) { // if bends enabled
if (bHasBends && !bHasRuffles) { // if bends enabled, but not ruffles
fRingBend = cos((fRing * m_fBends + m_fBendPhase) * M_PI * 2);
ApplyMotif(m_iBendMotif, fRingBend);
}
fRingRad = fRad;
}
double fRingTwist = m_fTwist * M_PI * 2 * fRing; // optimization
double fRingPhase = (m_fTwist * fRing + m_fRingPhase) * M_PI * 2; // optimization
if (bHasHelix) { // if helix enabled
double fHelixTheta = fRing * m_fHelixFrequency * M_PI * 2;
vOrigin.x = sin(fHelixTheta) * m_fHelixAmplitude;
Expand Down Expand Up @@ -462,6 +465,15 @@ void CPotGraphics::CalcPotMesh()
}
}
if (bHasBends) { // if bends enabled
if (bHasRuffles) { // if ruffles enabled, fRingBend can vary per side
double fPhase = fSide * m_fRuffles + m_fBendPolePhase + m_fRufflePhase;
double fRuffle = GetWave(m_iRuffleWaveform + 1, fPhase, m_fRufflePulseWidth, m_fRuffleSlew);
ApplyMotif(m_iRuffleMotif, fRuffle);
ApplyPower(CModulationProps::RANGE_BIPOLAR, m_iRufflePowerType, m_fRufflePower, fRuffle);
fRuffle = fRing + fRuffle * m_fRuffleDepth;
fRingBend = cos((fRuffle * m_fBends + m_fBendPhase) * M_PI * 2);
ApplyMotif(m_iBendMotif, fRingBend);
}
double r = fRingBend * cos((fSide * m_fBendPoles + m_fBendPolePhase) * M_PI * 2);
ApplyMotif(m_iBendPoleMotif, r);
ApplyPower(CModulationProps::RANGE_BIPOLAR, m_iBendPowerType, m_fBendPower, r);
Expand All @@ -484,7 +496,7 @@ void CPotGraphics::CalcPotMesh()
fRad = max(fRad, 0); // avoid negative radius
v.t = m_arrVert[iVert - nWallStride].t; // copy outer wall's texture coords
}
double fTheta = fDelta * iSide + fRingTwist;
double fTheta = fDelta * iSide + fRingPhase;
double x = sin(fTheta) * m_fAspectRatio;
double y = cos(fTheta);
double z = (fRing - 0.5) * fHeight;
Expand Down
25 changes: 21 additions & 4 deletions PotterDraw/PotProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
04 23nov17 add modulation type flags
05 24nov17 add animated modulation methods
06 12dec17 add operations (subset of modulation operations)
07 12dec17 bump file version to 3
07 12dec17 bump file version to 3 for app version 1.0.5
08 02jan18 bump file version to 4 for app version 1.0.6
09 15jan18 add view subgroup for auto rotate
*/

Expand All @@ -27,7 +29,7 @@
#include "PotGraphics.h" // for style bits

#define FILE_ID _T("PotterDraw")
#define FILE_VERSION 3
#define FILE_VERSION 4

#define RK_FILE_ID _T("sFileID")
#define RK_FILE_VERSION _T("nFileVersion")
Expand Down Expand Up @@ -57,6 +59,11 @@ const CProperties::OPTION_INFO CPotProperties::m_MeshSubgroup[MESH_SUBGROUPS] =
#include "PotPropsDef.h"
};

const CProperties::OPTION_INFO CPotProperties::m_ViewSubgroup[VIEW_SUBGROUPS] = {
#define VIEWSUBGROUPDEF(name) {_T(#name), IDS_PDR_SUBGROUP_VIEW_##name},
#include "PotPropsDef.h"
};

const CProperties::OPTION_INFO CPotProperties::m_ColorPattern[COLOR_PATTERNS] = {
#define PATTERNDEF(name) {_T(#name), IDS_PDR_OPT_COLPAT_##name},
#include "PotPropsDef.h"
Expand Down Expand Up @@ -177,9 +184,19 @@ CString CPotProperties::GetSubgroupName(int iGroup, int iSubgroup) const
{
ASSERT(IsValidGroup(iGroup));
CString sName;
if (iGroup == GROUP_MESH) {
sName.LoadString(m_MeshSubgroup[iSubgroup].nNameID);
int nNameID;
switch (iGroup) {
case GROUP_MESH:
nNameID = m_MeshSubgroup[iSubgroup].nNameID;
break;
case GROUP_VIEW:
nNameID = m_ViewSubgroup[iSubgroup].nNameID;
break;
default:
nNameID = 0;
}
if (nNameID)
sName.LoadString(nNameID);
return sName;
}

Expand Down
14 changes: 14 additions & 0 deletions PotterDraw/PotProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
04 23nov17 add modulation type flags
05 24nov17 add animated modulation methods
06 12dec17 add operations (subset of modulation operations)
07 02jan18 add ruffle properties
08 15jan18 add view subgroup for auto rotate
*/

Expand Down Expand Up @@ -49,6 +51,11 @@ class CPotProperties : public CProperties {
#include "PotPropsDef.h"
MESH_SUBGROUPS
};
enum { // view subgroups
#define VIEWSUBGROUPDEF(name) SUBGROUP_##name,
#include "PotPropsDef.h"
VIEW_SUBGROUPS
};
enum { // color patterns
#define PATTERNDEF(name) COLORPAT_##name,
#include "PotPropsDef.h"
Expand Down Expand Up @@ -76,6 +83,7 @@ class CPotProperties : public CProperties {
};
static const OPTION_INFO m_Group[GROUPS]; // group names
static const OPTION_INFO m_MeshSubgroup[MESH_SUBGROUPS]; // mesh subgroup names
static const OPTION_INFO m_ViewSubgroup[VIEW_SUBGROUPS]; // view subgroup names
static const OPTION_INFO m_ColorPattern[COLOR_PATTERNS]; // pattern names
static const OPTION_INFO m_PaletteType[PALETTE_TYPES]; // palette types
static const OPTION_INFO m_Motif[MOTIFS]; // motifs
Expand Down Expand Up @@ -129,6 +137,7 @@ class CPotProperties : public CProperties {
bool HasScallops() const;
bool HasRipples() const;
bool HasBends() const;
bool HasRuffles() const;
bool HasHelix() const;
bool HasModulations() const;
bool HasAnimatedModulations() const;
Expand Down Expand Up @@ -176,6 +185,11 @@ inline bool CPotProperties::HasBends() const
return (m_fBends && m_fBendDepth) || IsModulated(PROP_fBends) || IsModulated(PROP_fBendDepth);
}

inline bool CPotProperties::HasRuffles() const
{
return (m_fRuffles && m_fRuffleDepth) || IsModulated(PROP_fRuffles) || IsModulated(PROP_fRuffleDepth);
}

inline bool CPotProperties::HasHelix() const
{
return (m_fHelixFrequency && m_fHelixAmplitude) || IsModulated(PROP_fHelixFrequency) || IsModulated(PROP_fHelixAmplitude);
Expand Down
28 changes: 25 additions & 3 deletions PotterDraw/PotPropsDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
10 12dec17 for ripple and bend, add operation, power and power type
11 12dec17 add transparent render style
12 15dec17 add edges color pattern
13 02jan18 add ruffle properties
14 03jan18 add ring phase
15 15jan18 add view subgroup for auto rotate; add auto zoom
*/

Expand All @@ -38,11 +41,19 @@ MESHSUBGROUPDEF( POLYGON )
MESHSUBGROUPDEF( SCALLOP )
MESHSUBGROUPDEF( RIPPLE )
MESHSUBGROUPDEF( BEND )
MESHSUBGROUPDEF( RUFFLE )
MESHSUBGROUPDEF( HELIX )

#undef MESHSUBGROUPDEF
#endif

#ifdef VIEWSUBGROUPDEF

VIEWSUBGROUPDEF( AUTOROTATE )

#undef VIEWSUBGROUPDEF
#endif

#ifdef PROPDEF

// group subgroup proptype type name initval minval maxval itemname items
Expand All @@ -51,6 +62,7 @@ PROPDEF( MESH, NONE, VAR, int, nSides, 100, 3, SHRT_MAX, NULL, 0)
PROPDEF( MESH, NONE, VAR, double, fRadius, 1, 1e-6, 1e6, NULL, 0)
PROPDEF( MESH, NONE, VAR, double, fWallThickness, 5, 1e-6, 1e6, NULL, 0)
PROPDEF( MESH, NONE, VAR, double, fTwist, 0, 0, 0, NULL, 0)
PROPDEF( MESH, NONE, VAR, double, fRingPhase, 0, 0, 0, NULL, 0)
PROPDEF( MESH, NONE, VAR, double, fAspectRatio, 1, 0.1, 10.0, NULL, 0)
PROPDEF( MESH, POLYGON, VAR, double, fPolygonSides, 0, 0, 1e6, NULL, 0)
PROPDEF( MESH, POLYGON, VAR, double, fPolygonRoundness, 0, -1.0, 1.0, NULL, 0)
Expand Down Expand Up @@ -84,6 +96,15 @@ PROPDEF( MESH, BEND, ENUM, int, iBendPoleMotif, 0, 0, 0, m_Motif, _c
PROPDEF( MESH, BEND, ENUM, int, iBendOperation, 0, 0, 0, m_Operation, _countof(m_Operation))
PROPDEF( MESH, BEND, VAR, double, fBendPower, 0, 0, DBL_MAX, NULL, 0)
PROPDEF( MESH, BEND, ENUM, int, iBendPowerType, 0, 0, 0, CModulationProps::m_PowerType, _countof(CModulationProps::m_PowerType))
PROPDEF( MESH, RUFFLE, VAR, double, fRuffles, 0, 0, 0, NULL, 0)
PROPDEF( MESH, RUFFLE, VAR, double, fRuffleDepth, 0, 0, 0, NULL, 0)
PROPDEF( MESH, RUFFLE, VAR, double, fRufflePhase, 0, 0, 0, NULL, 0)
PROPDEF( MESH, RUFFLE, ENUM, int, iRuffleWaveform, 0, 0, 0, CModulationProps::m_Waveform + 1, _countof(CModulationProps::m_Waveform) - 1)
PROPDEF( MESH, RUFFLE, ENUM, int, iRuffleMotif, 0, 0, 0, m_Motif, _countof(m_Motif))
PROPDEF( MESH, RUFFLE, VAR, double, fRufflePower, 0, 0, DBL_MAX, NULL, 0)
PROPDEF( MESH, RUFFLE, ENUM, int, iRufflePowerType, 0, 0, 0, CModulationProps::m_PowerType, _countof(CModulationProps::m_PowerType))
PROPDEF( MESH, RUFFLE, VAR, double, fRufflePulseWidth, 0.5, 0, 0, NULL, 0)
PROPDEF( MESH, RUFFLE, VAR, double, fRuffleSlew, 0.5, 0, 0, NULL, 0)
PROPDEF( MESH, HELIX, VAR, double, fHelixFrequency, 0, 0, 0, NULL, 0)
PROPDEF( MESH, HELIX, VAR, double, fHelixAmplitude, 0, 0, 0, NULL, 0)
PROPDEF( TEXTURE, NONE, FILE, CString, sTexturePath, _T(""), 0, 0, NULL, 0)
Expand All @@ -101,11 +122,12 @@ PROPDEF( TEXTURE, NONE, VAR, double, fOffsetV, 0, 0, 0, NULL, 0)
PROPDEF( TEXTURE, NONE, VAR, double, fCyclesV, 1, 0, 0, NULL, 0)
PROPDEF( TEXTURE, NONE, VAR, double, fEdgeGain, 6.0, 0, 0, NULL, 0)
PROPDEF( VIEW, NONE, VAR, bool, bAnimation, 0, 0, 0, NULL, 0)
PROPDEF( VIEW, NONE, VAR, double, fAutoRotateYaw, 0, 0, 0, NULL, 0)
PROPDEF( VIEW, NONE, VAR, double, fAutoRotatePitch, 12, 0, 0, NULL, 0)
PROPDEF( VIEW, NONE, VAR, double, fAutoRotateRoll, 0, 0, 0, NULL, 0)
PROPDEF( VIEW, NONE, VAR, double, fFrameRate, 30, 0.01, 100.0, NULL, 0)
PROPDEF( VIEW, NONE, COLOR, COLORREF, clrBackground, 0xffffff, 0, 0, NULL, 0)
PROPDEF( VIEW, AUTOROTATE, VAR, double, fAutoRotateYaw, 0, 0, 0, NULL, 0)
PROPDEF( VIEW, AUTOROTATE, VAR, double, fAutoRotatePitch, 12, 0, 0, NULL, 0)
PROPDEF( VIEW, AUTOROTATE, VAR, double, fAutoRotateRoll, 0, 0, 0, NULL, 0)
PROPDEF( VIEW, AUTOROTATE, VAR, double, fAutoRotateZoom, 0, 0, 0, NULL, 0)

#undef PROPDEF
#endif
Expand Down
Loading

0 comments on commit 7a43b72

Please sign in to comment.