phetsims / quadrilateral

"Quadrilateral" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

Implement initial visual design #60

Closed brettfiedler closed 2 years ago

brettfiedler commented 2 years ago

This issue will be for creating this initial pass of the visual design

This pass includes: Dynamic lengths, angle guides, background color changes, checkbox controls for corner labels and angle guides.

To be covered still:

brettfiedler commented 2 years ago

I shared this design with JG and TS during the last virtual model meeting.

Mockups

Startup

Startup_allchecked

parallelogram_angleschecked

irregularquad

Colors used (RGB)

Focus Pink shape: 250 51 141 Desaturated blue background: 167 167 255 Angle guide grey: 100 100 100

These colors are just riffs on the existing color scheme and are not set in stone.

Notable modifications

Additions

Shape (Vertices and sides)

Segments grow to a set length, then a new one begin to draw until it reaches the set length, and so on.

Segment length will eventually depend on the number of "bins" needed to describe the side lengths relative to their opposite side. For now:

Angle guides

Corner labels

Labels center on the vertices. Currently labeled 1,2,3,4 from top left, clockwise which I believe matches the currently Voicing. This should change if the Voicing changes.

Control area

brettfiedler commented 2 years ago

Assigning @jessegreenberg to begin implementation! 🥳

I occasionally present a few other options for each feature that differ from the mockups - feel free to implement those instead if it is significantly easier and we can assess it at that point first.

Ping me here or in Slack for any questions that crop up ahead of design meeting.

jessegreenberg commented 2 years ago

Excellent! Collecting questions in this comment:

brettfiedler commented 2 years ago

Responses as of 2/14:

Excellent! Collecting questions in this comment:

  • [x] The vertices are going to be displayed circular but are square in the model (for hit detection with other sides and vertices). Is this OK?
  • [x] Similar question for the sides and their tapered width. Sides have a defined width in the model for hit detection, is it OK that the taper is purely graphical?

Yeah, I expected both of these!

  • [x] If the side segments are based on the size of the vertex, they aren't really based on the model value for the side width (more of a code consideration). What if we made the side width larger so that the initial side segment matches the model value for the side width.

This is probably fine. As long as the vertex grab takes precedence (is in "front"). I just don't think we'll want the grabbable area of the side to exceed the vertex width.

  • [x] >For the purposes of visualization, I think the first segment may need to be a bit longer...While playing with it it didn't seem necessary, but we can certainly do something like this.

Yeah, I suppose that feels true here after playing with it.

  • [x] At 5% taper per segment the sides can get very slim when the sides are stretched all the way across the play area.

It does. I'm not sure if that's a problem yet. Let's go ahead and retain the hit detection and pointer area for drag even with the small width and see how that feels for now.

brettfiedler commented 2 years ago

For archival purposes, the appearance I played with in answering the above: Quadrilateral screenshot

jessegreenberg commented 2 years ago

Discussed some points wiht @BLFiedler

jessegreenberg commented 2 years ago

OK, I think what is described in this issue has been implemented, including the angle guides and notes in https://github.com/phetsims/quadrilateral/issues/60#issuecomment-1039308535. Mouse/touch areas for sides can be verified again with ?showPointerAreas.

This is ready for your review @BLFiedler .

brettfiedler commented 2 years ago

Changes to current visual design

Additions to current visual design

Once all of these are in along with their sounds, it's time to decide what needs to be smoothed, tweaked, or altogether eliminated...

brettfiedler commented 2 years ago

This is to address the fact that the shape stops looking like a shape and introduces asymmetry. Also, it will bring the visuals in line with the pointer areas.

jessegreenberg commented 2 years ago

OK I think I am caught up to spec here. Ready for review. Just noting some things that may or may not be important.

1) Without the taper there isn't a need for custom mouse/touch areas. The sides are the touch areas and you won't see a unique highlight with ?showPointerAreas. 2) If the angle guides are invisible when at right angle, the "Angle Guides" checkbox does nothing if pressed on sim startup. 3) There are oddities going on because all of the angle checks here use the same angleToleranceInterval as the one used to determine if it is a parallelogram. So there are cases currently where right angle indicators are displayed when the model thinks we are not a parallelogram.

jessegreenberg commented 2 years ago

For #3 above, @BLFiedler suggested on slack

We can either gate it within being a parallelogram or tighten the 90 tolerance. I'm leaning toward the latter though.

Ill add another tolerance variable just for the 90 degree indicators and see how it goes.

jessegreenberg commented 2 years ago

I added a new tolerance that controls when right angle indicators are displayed. Can be controlled with ?rightAngleIndicatorToleranceInterval. Default value is 0.025. This value does not change with input like the angleToleranceInterval.

OK assigning to @BLFiedler to review the last three comments and the current behavior of the simulation.

brettfiedler commented 2 years ago

One note on the implementation of the right angle markers - The right angles should only appear when ALL angles are right angles. The intention is to highlight the property of a square/rectangle is important, not that a particular angle is 90 degrees.

Had a long discussion with Taliesin on these and other scaffolding topics, but I'll keep thinking about the meshing of tolerance for parallelogram and the markers.

jessegreenberg commented 2 years ago

I see, sorry I misread that. Fixed in the above commit. With this behavior I think there may not be a tolerance issue anymore. Now the right angle indicators can only be visible if the shape is a square or rectangle. And we can only have square or rectangle if the model is in a parallelogram state. rightAngleIndicatorToleranceInterval is no longer used. Back to @BLFiedler for review.

brettfiedler commented 2 years ago

Visual tweaks are ongoing in other issues.