Post Reply 
GROBW/GROBH vs GROBW_P/GROBH_P
10-11-2018, 12:52 PM (This post was last modified: 10-11-2018 02:11 PM by sasa.)
Post: #6
RE: GROBW/GROBH vs GROBW_P/GROBH_P
(10-11-2018 02:46 AM)Tim Wessman Wrote:  There are no bugs here and the explanation is correct....

It is evident that the center of the screen is shifted up for 10 pixels and down rest of the bottom not accessible if used values from these functions:

Code:

export SZ_GR_T4()
begin 

//Reset to default values, if any previous program change it
//  Xmin := −15.9;
//  Xmax :=  15.9;
//  Ymin := −10.9;
//  Ymax :=  10.9;

  local x,y;
  local c_r := #FF0000;

  local sx:= GROBW/GROBW_P;
  local sy:= GROBH/GROBH_P;

  rect_p(255);

  wait(1);

  // Fill all available Cartesian plane pixel by pixel
  for y := -GROBH/2 to GROBH/2 step sy do
  for x := -GROBW/2 to GROBW/2 step sx do 
    pixon(x,y,#333333);
  end;
  end;

  wait(1);
 
  line_p(0, grobh_p/2-1, grobw_p-1, grobh_p/2-1, #00FFFF);   
  pixon_p(0,0, c_r);
  pixon_p(grobw_p-1, grobh_p-1, c_r);
  
  line(0,grobh/2, 0, -grobh/2, c_r);
  line(-grobw/2,0,grobw/2,0,c_r); 

  wait(1);

  for y := -grobh/2 to grobh/2 do 
    pixon(0,y, #FFFFFF);
  end;
 
  freeze;
  
end;

One horizontal and one vertical line will be only off, if make calculations to be exact and return exactly 32x24 for Cartesian plane, in order to display all correctly - including center (0,0) to be shown with only one line off.

Once again, C→PX(0,0) returns {160, 110}
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-10-2018, 11:27 PM
RE: GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-11-2018, 02:34 AM
RE: GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-11-2018, 01:27 PM
RE: GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-11-2018, 07:34 PM
RE: GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-11-2018 12:52 PM
RE: GROBW/GROBH vs GROBW_P/GROBH_P - sasa - 10-12-2018, 06:46 AM



User(s) browsing this thread: 1 Guest(s)