Skip to content

Commit

Permalink
shaking hand is awesome and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dipsywong98 committed Mar 19, 2019
1 parent ac1d142 commit 0584da2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
25 changes: 15 additions & 10 deletions MyModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ void MyModel::draw()
drawLathe({ {0, 0.96}, {0.5, 1}, {0.84, 1.3}, {0.83, 1.84}, {0, 1.84}});
glPopMatrix();

if (VAL(SHOWPRISM)) {
drawTest();
}

// draw ik target point
if(VAL(IKENABLE))
{
Expand Down Expand Up @@ -232,18 +236,19 @@ void MyModel::drawArm(int levels, int curDept)
glRotated(VAL(ARM1V + curDept*2)+(mood==1)*moodTick, 0, 1, 0);

if (mood == 2)
glTranslated(levels*sin(32 * rad(levels*moodTick)) / 1000.f, 0, levels*cos(32 * rad(levels*moodTick)) / 1000.f);
glTranslated(levels*sin(32 * rad(levels*moodTick)) / 100.f, 0, levels*cos(32 * rad(levels*moodTick)) / 100.f);

//vertical arm cylinder
glPushMatrix();
if(VAL(BOXARMS)==0)
{
glRotated(-90, 1, 0, 0);
drawCylinder(2, 1, 1);
}else
{
glTranslated(-1, 0, -0.5);
drawBox(2, 2, 1);
}
if(VAL(BOXARMS)==0)
{
glRotated(-90, 1, 0, 0);
drawCylinder(2, 1, 1);
}else
{
glTranslated(-1, 0, -0.5);
drawBox(2, 2, 1);
}
glPopMatrix();

//joint cylinder
Expand Down
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ int main()
controls[LTHICKNESS] = ModelerControl("Lsystem: thickness", 0.01, 1, 0.01, 0.1);
controls[LDECAYTHICKNESS] = ModelerControl("Lsystem: decay thickness", 0.01, 10, 0.01, 1);
controls[LDECAYLENGTH] = ModelerControl("Lsystem: decay length", 0.01, 10, 0.01, 1);
controls[BALLJOINTS] = ModelerControl("Ball joints", 0, 1,1, 0);
controls[BALLJOINTS] = ModelerControl("Ball joints", 0, 1,1, 1);
controls[BOXARMS] = ModelerControl("Box Arms", 0, 1,1, 0);
controls[IKENABLE] = ModelerControl("IK: enable", 0, 1,1, 0);
controls[IKX] = ModelerControl("IK: X", -10, 10,0.01, 3);
controls[IKY] = ModelerControl("IK: Y", -10, 10,0.01, 3);
controls[IKZ] = ModelerControl("IK: Z", -10, 10,0.01, 3);
controls[IKMIN] = ModelerControl("IK: Min", -180, 180,1, -90);
controls[IKMAX] = ModelerControl("IK: Max", -180, 180,1, 90);
controls[SHOWPRISM] = ModelerControl("Show Prism", 0, 1, 1, 0);

ModelerApplication::Instance()->Init(&createSampleModel, controls, NUMCONTROLS);
return ModelerApplication::Instance()->Run();
Expand Down
3 changes: 2 additions & 1 deletion modelerglobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ enum SampleModelControls
ENABLEANIM, CYCLINGMOOD,
LDISP, LDEPTH, LANGLE, LLEN, LTHICKNESS, LDECAYTHICKNESS, LDECAYLENGTH,
BALLJOINTS, BOXARMS,
IKENABLE, IKX, IKY, IKZ, IKMIN, IKMAX, NUMCONTROLS
IKENABLE, IKX, IKY, IKZ, IKMIN, IKMAX,
SHOWPRISM, NUMCONTROLS
};

// Colors
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ B: Bell, W: Whistle, 1B=2W
- [x] (1B) Widget to control param and create individual-looking instances
- [x] **(1B)** Fit whole model in camera (Frame All)
- [x] (1B1W) an intuitive way for the user to twist the camera via mouse control.
- [ ] *(2B)* New primitives (is it 2B for each)
- [x] *(2B)* New primitives (is it 2B for each)
- [ ] 1. Given Curve A and B, surface form by sweep A through B
- [ ] 2. Given Curve A and stright line L, surface form by rotate A about L
- [x] 2. Given Curve A and stright line L, surface form by rotate A about L
- [ ] 3. Torus
4. Others base on coolness
- [x] (2B) procedural modelling with parameter control [L-system](https://en.wikipedia.org/wiki/L-system)
Expand Down

0 comments on commit 0584da2

Please sign in to comment.