Вверх ↑
Ответов: 8926
Рейтинг: 823
#1: 2020-04-10 20:40:16 ЛС | профиль | цитата
Rysik, вращение точечного рисунка (как в GL) по тем формулам,что приведены выше. "Камера" смотрит в начало координат.
(рисунок представлен двумя списками -- координаты точек и список линий между точками)
Вращение


Add(MainForm,2953706,84,84)
{
Width=394
Height=297
link(onCreate,13532123:doWork2,[])
}
Add(Image,940853,210,182)
{
Left=115
Width=257
Height=257
Align=5
link(Bitmap,4849564:Var2,[])
}
Add(ChildPanel,5628189,469,21)
{
link(onEvent1,7239926:doEvent1,[(515,27)(515,13)(74,13)(74,230)])
}
BEGIN_SDK
Add(EditMulti,14735680,21,21)
{
EventCount=1
VarCount=5
Width=496
Height=109
link(Var1,4981574:Result,[(27,89)(195,89)])
link(Var2,3527821:Result,[(34,96)(237,96)])
link(Var3,5030946:Result,[(41,103)(335,103)])
link(Var4,16482321:Result,[(48,110)(377,110)])
link(Var5,1924021:Result,[(55,117)(468,117)])
}
Add(Panel,16284873,42,42)
{
Width=115
Height=258
Align=1
}
Add(ScrollBar,15295475,140,42)
{
Left=5
Top=20
Max=180
Min=-180
Page=30
link(onPosition,4981574:doOperation,[])
}
Add(ScrollBar,16548903,280,42)
{
Left=5
Top=40
Max=180
Min=-180
Page=15
link(onPosition,5030946:doOperation,[])
}
Add(ScrollBar,12691736,420,42)
{
Left=5
Top=115
Max=1050
Min=50
Page=50
Position=230
link(onPosition,1924021:doOperation,[])
}
Add(Label,14329419,84,35)
{
Left=17
Top=5
Width=83
Height=17
Caption="Вектор камеры"
}
Add(Label,283661,91,42)
{
Left=20
Top=85
Width=69
Height=27
Caption="Расстояние\r\nдо камеры"
AutoSize=1
}
Add(Math,1924021,462,42)
{
OpType=3
Op2=230
Default=1
link(onResult,3971111:doWork3,[(501,48)])
}
Add(HubEx,3971111,497,21)
{
link(onEvent,14735680:onEvent1,[])
}
Add(Math,4981574,189,42)
{
OpType=13
AngleMode=1
link(onResult,3527821:doOperation,[])
}
Add(Math,3527821,231,42)
{
OpType=12
Default=1
AngleMode=1
link(onResult,15434192:doWork2,[(269,48)(269,27)])
link(Op1,15295475:Position,[(237,33)(181,33)(181,82)(146,82)])
}
Add(Math,5030946,329,42)
{
OpType=13
AngleMode=1
link(onResult,16482321:doOperation,[])
}
Add(Math,16482321,371,42)
{
OpType=12
Default=1
AngleMode=1
link(onResult,15434192:doWork3,[(410,48)])
link(Op1,16548903:Position,[(377,33)(321,33)(321,82)(286,82)])
}
Add(HubEx,15434192,406,21)
{
link(onEvent,3971111:doWork2,[])
}
END_SDK
Add(StrList,4649051,217,35)
{
Strings=#7:0;0;100|35:95.1056516295154;0;30.9016994374947|36:58.7785252292473;0;-80.9016994374947|37:-58.7785252292473;0;-80.9016994374948|36:-95.1056516295154;0;30.9016994374947|35:23.5114100916989;0;32.3606797749979|36:38.0422606518061;0;-12.3606797749979|26:4.90059381963448E-15;0;-40|37:-38.0422606518061;0;-12.3606797749979|36:-23.5114100916989;0;32.3606797749979|6:0;20;0|7:0;-20;0|
}
Add(StrList,8290227,161,168)
{
Strings=#3:0;5|3:5;1|3:1;6|3:6;2|3:2;7|3:7;3|3:3;8|3:8;4|3:4;9|3:9;0|4:0;10|4:0;11|4:5;10|4:5;11|4:1;10|4:1;11|4:6;10|4:6;11|4:2;10|4:2;11|4:7;10|4:7;11|4:3;10|4:3;11|4:8;10|4:8;11|4:4;10|4:4;11|4:9;10|4:9;11|
}
Add(StrList,8160598,273,35)
{
}
Add(Bitmap,307715,210,133)
{
HWidth=513
HHeight=513
FillColor=12639424
Point(doCreate)
}
Add(ArrayEnum,10534496,161,231)
{
link(onItem,13186016:doSplit,[])
link(onEndEnum,940853:doLoad,[(200,244)(200,188)])
link(Array,8290227:Array,[(167,222)(181,222)])
}
Add(MultiStrData,13186016,210,231)
{
link(onPart1,490219:doWork2,[])
link(onPart2,14693560:doEvent1,[])
}
Add(ArrayRW,3246052,294,231)
{
link(onRead,7127200:doValue,[])
link(Array,6438747:Var2,[(300,166)(293,166)])
}
Add(Hub,14693560,259,238)
{
link(onEvent1,490219:doWork3,[(284,244)])
link(onEvent2,15819491:doSplit,[(284,251)(284,286)])
}
Add(HubEx,490219,280,231)
{
link(onEvent,3246052:doRead,[])
}
Add(MemFifo,7127200,343,231)
{
}
Add(FormatStr,4767181,364,56)
{
}
Add(MultiStrPart,15819491,343,280)
{
Count=3
link(onSplit,1240148:doSplit,[])
link(Str,7127200:Value1,[])
}
Add(MultiStrPart,1240148,385,280)
{
Count=3
link(onSplit,7157882:doCalc,[(431,286)(431,328)(333,328)(333,363)])
link(Str,7127200:Value2,[(391,271)(356,271)])
}
Add(Img_Line,4995999,462,357)
{
Point(Point1)
Point(Point2)
Point(Size)
Point(Color)
link(Bitmap,4849564:Var3,[(468,173)])
link(Point1,7157882:Result,[(475,348)(454,348)(454,404)(349,404)])
link(Point2,3271348:Result,[(482,341)(447,341)(447,397)(398,397)])
link(Size,12668683:Value,[])
link(Color,15341182:Value,[])
}
Add(MathParse,7157882,343,357)
{
DataCount=3
MathStr="round(%1*%3+256) + round(256-%2*%3)*65536"
link(onResult,3271348:doCalc,[])
link(X1,15819491:Part1,[])
link(X2,15819491:Part3,[(356,320)(363,320)])
link(X3,4032748:Var1,[(363,334)])
}
Add(MathParse,3271348,392,357)
{
DataCount=3
MathStr="round(%1*%3+256) + round(256-%2*%3)*65536"
link(onResult,4995999:doDraw,[])
link(X1,1240148:Part1,[(398,320)(391,320)])
link(X2,1240148:Part3,[])
link(X3,4032748:Var2,[])
}
Add(GetDataEx,4849564,210,168)
{
link(Data,307715:Bitmap,[])
}
Add(Hub,7239926,84,224)
{
link(onEvent1,13532123:doWork3,[(130,230)])
link(onEvent2,8936359:doWork2,[])
}
Add(HubEx,13532123,126,98)
{
link(onEvent,6918653:doEvent1,[])
}
Add(Memory,12668683,483,266)
{
Default=Integer(2)
}
Add(Memory,15341182,490,273)
{
Default=Integer(255)
}
Add(Hub,6918653,168,98)
{
OutCount=4
link(onEvent1,16382225:doData,[])
link(onEvent2,16321513:doFor,[])
link(onEvent3,307715:doCreate,[(200,118)(200,153)])
link(onEvent4,8936359:doWork1,[(193,125)(193,160)(137,160)])
}
Add(DoData,16382225,217,98)
{
link(onEventData,8160598:doText,[(256,104)(256,62)])
link(Data,4649051:Text,[])
}
Add(ArrayRW,7148505,315,105)
{
link(onRead,13935014:doSplit,[])
link(Array,6438747:Var3,[(321,89)])
link(Index,16321513:Position,[(328,96)(300,96)(300,145)(265,145)])
}
Add(For,16321513,259,105)
{
IncludeEnd=1
link(onEvent,7148505:doRead,[])
link(End,8160598:Count,[(272,89)(286,89)])
}
Add(GetDataEx,6438747,287,84)
{
link(Data,8160598:Array,[])
}
Add(MathParse,15833163,455,105)
{
DataCount=4
MathStr="%1*%4 + %2*%3"
link(onResult,1956732:doCalc,[])
link(X1,1104944:Var2,[])
link(X2,4499750:Var2,[])
link(X3,5059694:Var2,[])
link(X4,10552763:Var2,[])
}
Add(MathParse,1956732,511,105)
{
DataCount=4
MathStr="%2*%4 - %1*%3"
link(onResult,15812575:doCalc,[])
link(X1,1104944:Var3,[(517,96)])
link(X2,4499750:Var3,[(524,89)])
link(X3,5059694:Var3,[(531,82)])
link(X4,10552763:Var3,[(538,75)])
}
Add(MultiStrPart,13935014,364,105)
{
Count=3
link(onSplit,15833163:doCalc,[])
}
Add(GetDataEx,1104944,455,91)
{
Angle=3
link(Data,13935014:Part1,[(447,96)(447,151)(370,151)])
}
Add(GetDataEx,4499750,462,84)
{
Angle=3
link(Data,13935014:Part3,[(440,89)(440,145)(384,145)])
}
Add(GetDataEx,4032748,406,329)
{
Angle=1
link(Data,5628189:Var5,[(475,334)(475,257)(503,257)])
}
Add(GetDataEx,5059694,469,77)
{
link(Data,5628189:Var1,[])
}
Add(GetDataEx,10552763,476,70)
{
link(Data,5628189:Var2,[])
}
Add(FormatStr,4227856,714,105)
{
DataCount=3
Mask="%1;%2;%3"
link(onFString,7148505:doWrite,[(760,111)(760,167)(305,167)(305,118)])
link(Str1,15812575:Result,[(720,89)(666,89)(666,145)(580,145)])
link(Str3,1956732:Result,[(734,96)(706,96)(706,152)(517,152)])
}
Add(MathParse,15812575,574,105)
{
DataCount=4
MathStr="%1*%4 + %2*%3"
link(onResult,12602015:doCalc,[])
link(X1,5738179:Var2,[])
link(X2,4523641:Var2,[])
link(X3,3669471:Var2,[])
link(X4,2476468:Var2,[])
}
Add(MathParse,12602015,630,105)
{
DataCount=4
MathStr="%2*%4 - %1*%3"
link(onResult,4227856:doString,[])
link(X1,5738179:Var3,[(636,89)])
link(X2,4523641:Var3,[(643,96)])
link(X3,3669471:Var3,[(650,68)])
link(X4,2476468:Var3,[(657,61)])
}
Add(GetDataEx,3669471,588,63)
{
Angle=3
link(Data,5628189:Var3,[(489,68)])
}
Add(GetDataEx,2476468,595,56)
{
Angle=3
link(Data,5628189:Var4,[(496,61)])
}
Add(GetDataEx,5738179,574,84)
{
Angle=3
link(Data,15833163:Result,[(549,89)(549,148)(461,148)])
}
Add(GetDataEx,4523641,581,91)
{
Angle=3
link(Data,13935014:Part2,[(566,96)(566,159)(377,159)])
}
Add(HubEx,8936359,133,231)
{
link(onEvent,10534496:doEnum,[])
}

карма: 19

0