Thema: Delphi 3D-Rotation

Einzelnen Beitrag anzeigen

eyeless

Registriert seit: 12. Aug 2005
49 Beiträge
 
#3

Re: 3D-Rotation

  Alt 9. Feb 2006, 12:40
Jo, das hab ich mir auch schon gedacht, aber selbst wenn ich jez statt z.B. n Grad n*(pi/180) rad nehme, ist nach ca 40-45 Grad (rund 0.7 rad) der Würfel nur noch ein sehr dünner Quader ... warum?

Bsp im Anhang ...

Das komische ist auch, wenn ich das ganze rad für rad auf zu sagen wir mal 60*(pi/180) rad drehe, wird das ding einfach nur klein ... wenn ich aber auf einmal auf 60*(pi/180) drehe, vermurkst es mir total ...nochmal: warum?

hier mal der code:

Delphi-Quellcode:
procedure TForm3D.StartClick(Sender: TObject); // dreh rad für rad
begin
  roti := roti+1;
  Cube.rot(roti*rad,0,0);
  Scr3D.Repaint;
  Label2.Caption := '°:'+intToStr(roti);
  Label3.Caption := 'rad:'+FloatToStr(roti*rad);
end;

procedure TForm3D.Button1Click(Sender: TObject); // dreh um 60 Grad
begin
  Cube.rot(60*rad,0,0);
  Scr3D.Repaint;
  Label2.Caption := '°:'+intToStr(60);
  Label3.Caption := 'rad:'+FloatToStr(60*rad);
end;
EDIT:

Ich habe mir auch gerade überlegt, das vieleicht das roti vor dem rad falsch ist und habe einfach immer um rad gedreht, bei ca 700 Grad sieht man aber auch eine Verengung .. vieleicht wäre erstmal ein Notlösung, dass ich immer um n-((n DIV 360)*360), wobei n der Winkel ist vor jeder neuen Rotation erstmal die Ursprungs-Rotation wiederherstelle und dann erst um den neuen Winkel dazu drehe ... oder so

mfg, eyeless
Angehängte Dateien
Dateityp: rar 3d-rot-w32-rad_913.rar (163,4 KB, 12x aufgerufen)
  Mit Zitat antworten Zitat