Skip to content

Commit

Permalink
回転倍率
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin117117 committed May 2, 2021
1 parent ecf5723 commit b893aef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
18 changes: 10 additions & 8 deletions J3D_BCK_Editor/File_Edit/BCK_System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,26 +204,28 @@ public void Rot_Mode(bool dgv_write)
}
}

int frac = 1;
int from_txt_frac= Int32.Parse( Txt_Rot_Frac.Text);
for (int f = 0; f <0 /*from_txt_frac*/; f++)
{
if (f!=0) { frac = frac*10; }
}
//int frac = 1;
//int from_txt_frac= Int32.Parse( Txt_Rot_Frac.Text);
//for (int f = 0; f < from_txt_frac; f++)
//{
// if (f!=0) { frac = frac*10; }
//}


foreach (int a in rotList)
{
if (dgv_write == true)
{
dgv3float = Convert.ToSingle(dgv3.Rows[a].Cells["Rotation_Value"].Value.ToString());
dgv3float = (dgv3float / 182)*frac;
dgv3float = (dgv3float / 182);
dgv3.Rows[a].Cells["Rotation_Value"].Value = dgv3float.ToString();


}
else
{
dgv3float = float.Parse(dgv3.Rows[a].Cells["Rotation_Value"].Value.ToString());
dgv3float = (dgv3float /frac)*182;
dgv3float = (dgv3float )*182;
dgv3.Rows[a].Cells["Rotation_Value"].Value = Convert.ToInt16(dgv3float);
}
}
Expand Down
19 changes: 13 additions & 6 deletions J3D_BCK_Editor/File_Edit/Plot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ public void Draw(PictureBox pictureBox1)
pl_sfn = Plot_List_Rot_Combo[com1.SelectedIndex][0];
pl_cfn = Plot_List_Rot_Combo[com1.SelectedIndex][1];
pl_tan = Plot_List_Rot_Combo[com1.SelectedIndex][2];



int frac = 1;
int from_txt_frac = Int32.Parse(Txt_Rot_Frac.Text);
for (int f = 0; f < from_txt_frac; f++)
{
if (f != 0) { frac = frac * 10; }
}

List<PointF> l2pf = new List<PointF>();

Expand Down Expand Up @@ -94,28 +99,30 @@ public void Draw(PictureBox pictureBox1)
{
dgv3_fn2 = Convert.ToInt16(dgv3.Rows[i + (3 + pl_tan)].Cells["Rotation_Value"].Value);
dgv3_va2 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i + (3 + pl_tan) + 1].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta_2 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i + (3 + pl_tan) + 2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta_2 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i + (3 + pl_tan) + 2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat))/frac;
}

if (pl_sfn + (3 + pl_tan) < i )

{
debug.AppendText((i - (3 + pl_tan)).ToString());
debug.AppendText(dgv3.Rows[i - (3 + pl_tan)].Cells["Rotation_Value"].Value.ToString() + "ほし★");
Console.WriteLine(i - (3 + pl_tan));
Console.WriteLine(dgv3.Rows[i - (3 + pl_tan)].Cells["Rotation_Value"].Value);
Console.WriteLine(dgv3.Rows[i - (3 + pl_tan)].Cells["Rotation_Value"].Value+"ほし★");
dgv3_fn0 = Convert.ToInt16(dgv3.Rows[i - (3 + pl_tan)].Cells["Rotation_Value"].Value);
dgv3_va_0 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i - (3 + pl_tan)+1].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta_0 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i - (3 + pl_tan)+2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta_0 = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i - (3 + pl_tan)+2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat))/frac;
}
dgv3_va =float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i+1].Cells["Rotation_Value"].Value , CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i + 2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat));
dgv3_ta = float.Parse(string.Format("{0:0.##########}", dgv3.Rows[i + 2].Cells["Rotation_Value"].Value, CultureInfo.InvariantCulture.NumberFormat))/frac;
p0 = new PointF(dgv3_fn - Math.Abs(dgv3_fn0-dgv3_fn)/3, dgv3_va - ((dgv3_ta/92)*((dgv3_fn - Math.Abs(dgv3_fn0 - dgv3_fn) / 3)) ) / 3);
//p0 = new PointF(dgv3_fn - Math.Abs(dgv3_fn2 - dgv3_fn) / 3, dgv3_fn - Math.Abs(dgv3_fn2 - dgv3_fn) / 3 * (dgv3_ta/92)/3 );
p1 = new PointF(dgv3_fn, dgv3_va);

//タンジェントモードなし
if ((3 + pl_tan) == 3) {
//タンジェントモード「なし」のポイント設定&初期化
p2 = new PointF(dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn)/3, dgv3_va + ((dgv3_ta/92)*((dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn) / 3)) ) / 3);
p2 = new PointF(dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn)/3, dgv3_va + ((dgv3_ta / 92)*((dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn) / 3)) ) / 3);
//p2 = new PointF(dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn) / 3, dgv3_fn + Math.Abs(dgv3_fn2 - dgv3_fn) / 3 * (dgv3_ta/92)/3 );

//先頭と末尾だけポイント数を減らす
Expand Down

0 comments on commit b893aef

Please sign in to comment.