Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
0.8.3:water [2020/11/17 18:53] – external edit 127.0.0.1 | 0.8.3:water [2022/04/25 11:36] (current) – [Ripples] admin | ||
---|---|---|---|
Line 99: | Line 99: | ||
| RefrCorrection | By this value you can modify the color of refraction on water surface, default value: Vector3D(1.1, | | RefrCorrection | By this value you can modify the color of refraction on water surface, default value: Vector3D(1.1, | ||
+ | ==== Ripples ==== | ||
+ | |||
+ | Since 0.8.3.2265 the framwork supports rendering of water ripples. | ||
+ | |||
+ | Ripple settings are configurable at design time by the following properties, but need runtime implementation to add ripple positions. | ||
+ | |||
+ | ^Property^Description^ | ||
+ | |RipplesActive|Activate or deactivate ripple computation.| | ||
+ | |RippleAmplification|Get or set amplification value for ripples. Simply said: Amplification describes the height of the ripple.| | ||
+ | |RippleProximity|Get or set proximity value for ripples. Simply said: Proximity is the basis value for the width of a ripple.| | ||
+ | |RippleDecay|Get or set decay value for ripples. Simply said: It defines how fast a ripple will end.| | ||
+ | |||
+ | To add a ripple at a certain position use the TGorillaWaterMaterialSource.AddRipple() method. | ||
+ | |||
+ | __Warning: | ||
+ | |||
+ | <file pascal> | ||
+ | procedure TForm1.doOnViewportMouseUp(ASender : TObject; AButton : TMouseButton; | ||
+ | AShift : TShiftState; | ||
+ | var LPt3D : TPoint3D; | ||
+ | begin | ||
+ | /// add a ripple by clicking with the left mouse button onto the water plane (Caution: HitTest needs to be activated) | ||
+ | if (ssLeft in fShiftState) then | ||
+ | begin | ||
+ | LPt3D := GorillaViewport1.ScreenToWorld(PointF(X, | ||
+ | GorillaWaterMaterialSource1.AddRipple(Point3D(LPt3D.X, | ||
+ | end; | ||
+ | end; | ||
+ | </ | ||
===== Example ===== | ===== Example ===== | ||