Jump to content

Christian

Members
  • Content Count

    8
  • Joined

  • Last visited

  • Days Won

    1

Christian last won the day on August 12 2018

Christian had the most liked content!

About Christian

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Christian

    Providing Credentials to a Frame

    Hi, is there a way to set username and password to a W3IFrameHTMLElement, or how should i solve the following issue: I want to open a website running in a W3IFrameHTMLElement and this page requests credentials which i want to enter automatically. Christian
  2. Christian

    TW3Chart and TFloatArray issue

    I mean this: procedure TSeriesData.Refresh; begin asm (@Self.FHandle).values=((@FValues)); end; asm (@Self.FHandle).labels=((@FLabels)); end; asm (@Self.FHandle).colors=((@FColors)); end; //asm (@Self.FHandle).x=((@FX)); end; end; So Serie.Data.X.Add does not update the chart component, because Refresh ignores the X values. If you know it, it is not a big deal to work around this issue. I just wonder why this has been disabled. Christian
  3. Christian

    TW3Chart and TFloatArray issue

    Hi, today i thought i try to get in touch with the Tw3Chart. To do so i made a small example: const // Stefan-Boltzmann constant, and has the value 5.67 x 10-8(Wm-2K -4) cBoltzman = 0.0000000567; // 30% of the short wave radiation that hits the earth is bounced back into space. cAlbedo = 0.3; // A solar constant is the amount of radiation given off by the sun. // Over a long period of time this may change, but for this model we can // assume that it will stay at 1370. S is expressed in W / m2 or Watt per square meter cSolarConstant = 1370; procedure TForm1.InitializeForm; var carbon, atmosphere: single; Serie: TSeries; begin inherited; // this is a good place to initialize components W3Chart1.Title.Text := 'Simple Climate Model'; W3Chart1.Axes.Left.Title.Text := 'Temperature in °C'; W3Chart1.Axes.Bottom.Title.Text := 'Atmospherical absorbation'; Serie := TLineSeries.Create; W3Chart1.AddSeries(Serie); carbon := 0; while carbon < 1 do begin atmosphere := Power(((1 - cAlbedo) * cSolarConstant) / (4 * cBoltzman * (1 - carbon / 2)), 0.25) - 273; Serie.Data.Values.Add(atmosphere); Serie.Data.X.Add(Carbon); carbon := carbon + 0.1; end; Serie.RefreshData; end; The formula is based on this lecture: https://www.e-education.psu.edu/meteo469/node/198 Is there a reason why X is not updated and excluded in TSeriesData.Refresh? This work around does run okay, but has another annoying issue. It seem to be that you can not use 0.1 steps for the x axis. procedure TForm1.InitializeForm; var carbon, atmosphere: single; Serie: TSeries; X, Y: TFloatArray; begin inherited; // this is a good place to initialize components W3Chart1.Title.Text := 'Simple Climate Model'; W3Chart1.Axes.Left.Title.Text := 'Temperature in °C'; W3Chart1.Axes.Bottom.Title.Text := 'Atmospherical absorbation'; W3Chart1.Legend.Visible := false; Serie := TLineSeries.Create; W3Chart1.AddSeries(Serie); carbon := 0; while carbon < 1 do begin atmosphere := Power(((1 - cAlbedo) * cSolarConstant) / (4 * cBoltzman * (1 - carbon / 2)), 0.25) - 273; Y.Add(atmosphere); X.Add(Carbon*10);//somehow 0..1 does not work? carbon := carbon + 0.1; end; Serie.Data.X := X; Serie.Data.Values := Y; end; Christian
  4. Christian

    [3.0.0.12] IDE related issues

    The second exception is more annoying. If you create a new Project: Start a new Project -> Canvas Project -> Main->File->Save as.. then rename your Unit1.pas into e.h. UMain.pas and select in the combo box under Project Manager Unit1.pas. You will get an exception like this:
  5. Christian

    [3.0.0.12] IDE related issues

    Hi, i did not found the problems posted here, so i hope i'm the first one who does list them. If you change the Theme under Tools->IDE Settings->Appearance more than one time it crashes:
  6. Christian

    Pixelbuffer

    The gameplay is simple. Just click on a part of the map and your player moves to this position. By pressing the space bar you place a bomb (max. 10 bombs can be placed at a time). If you are in Range of the bomb you activate the timer by right mouse click. Aim is to bomb the builders and the building. I skip 2 frames in order to have at least 22fps. The performance can be increased by minimizing the for loops in the render procedure and the access to the arrays. It was just a proof of concept how to paint and i'm happy to figured it out. Christian
  7. Christian

    Pixelbuffer

    Hi, to be honest i already answered myself yesterday while studying the RTL code. It took a while to fiddle out how to deal with TW3ImageData. The result is attached to this post. Feel free to do whatever you want with this code. The render routine is extremely slow, but this is also the case in the original. You could drastically speed it up by replacing the tons of for loops. The gameplay is easy: Move your little buddy with the mouse and place bombs at the buildings while the constructors are assembling them. They will run away if they do not work. The right mouse button will activate the timer if you are nearby. Don't blow up yourself if you are in range. Before you ask: It is a remake of an very old java game. blowit.zip
  8. Christian

    Pixelbuffer

    Hi, i'm currently try to get familiar with Smart and to do so i started creating a small game in order to get familiar with the language. The game itself is based on an old tech demo i made and uses voxel graphics and porting it from Delphi 7 worked surprisingly well. I only got stuck in rendering the output. My Backbuffer looks like this: TBackBuffer = array[0..WorldHeight - 1, 0..WorldWidth - 1] of TColor; and i would like to paint the scene with the proper aspect ratio to the canvas as fast as possible. Under Windows i would use StretchDIBits for this. If everything works fine, i post the source.
×