File:Карта высот.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Карта_высот.png (637 × 478 pixels, file size: 56 KB, MIME type: image/png)
File information
Structured data
Captions
Summary
[edit]DescriptionКарта высот.png |
Русский: Карта высот English: height map |
Date | |
Source | Own work |
Author | Владислав Молдован |
Pascal src code
[edit]- RndMax - upper bound
uses GraphABC;
const
RndMax = 255;
type
Point3D = class
X, Y, Z: real;
constructor(px, py, pz: real);
begin
X := px;
Y := py;
Z := pz;
end;
end;
procedure Draw(pA, pC: Point3D; bZ, dZ: real);
begin
var pB := new Point3D(pC.X, pA.Y, bZ);
var pD := new Point3D(pA.X, pC.Y, dZ);
var cx := (pA.X + pB.X) / 2;
var cy := (pB.Y + pC.Y) / 2;
if (pB.X - pA.X) * (pC.Y - pB.Y) > 1 then
begin
var maxz := Max(Max(Max(pA.Z, pB.Z), pC.Z), pD.Z);
var minz := Min(Min(Min(pA.Z, pB.Z), pC.Z), pD.Z);
var randz := 0.0;
if maxz - minz > 0 then randz := minz + Random() * (maxz - minz);
var pCenter := new Point3D(cx, cy, randz);
var p1 := new Point3D(cx, pA.Y, (pA.Z + pB.Z) / 2);
var p2 := new Point3D(pB.X, cy, (pB.Z + pC.Z) / 2);
var p3 := new Point3D(cx, pC.Y, (pC.Z + pD.Z) / 2);
var p4 := new Point3D(pA.X, cy, (pD.Z + pA.Z) / 2);
Draw(pA, pCenter, p1.Z, p4.Z);
Draw(p1, p2, pB.Z, pCenter.Z);
Draw(pCenter, pC, p2.Z, p3.Z);
Draw(p4, p3, pCenter.Z, pD.Z);
end
else
begin
var zv := Round((pA.Z + pB.Z + pC.Z + pD.Z) / 4);
SetBrushColor(RGB(0, zv, 255));
FillRect(Round(pA.X), Round(pA.Y), Round(pC.X), Round(pC.Y));
end;
end;
begin
var W := Window.Width;
var H := Window.Height;
SetWindowIsFixedSize(true);
LockDrawing();
Draw(new Point3D(0, 0, Random(RndMax)), new Point3D(W, H, Random(RndMax)), Random(RndMax), Random(RndMax));
Redraw();
end.
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 09:32, 1 September 2017 | 637 × 478 (56 KB) | Владислав Молдован (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ru.wikibooks.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 37.79 dpc |
---|---|
Vertical resolution | 37.79 dpc |
Hidden categories: