HPGL question (full coordinate system??)

J

Jens

Hello,

I have a problem defining a HPGL coordinate system with "normal" orientation
and all 4 axes so
I can use negative coordinates as well. I have uploaded a jpg-picture which
explains in more
detail what it is that I want to do:

See here:
http://img245.imageshack.us/img245/2360/hpglml7.jpg


The following is the relevant part of my HPGL/PCL code:

*c0T
&f32760Y
&f0X
&u600D
%1B
IN;
SP1;
SC0,1.6933,0,-1.6933,2;
IR0,100,0,100;
PU 50,50;
PD -50,50;
PD -50,-50;
PD 50,-50;
PD 50,50;
%1A
&f1X&f9X&f32760y3X



Can anybody tell me how I configure a HPGL coordinate system which makes it
possible
to use negative coordinates. The origin of the coordinate system must always
be the
latest PCL cursor position. And the coordinate system must have "normal
orientation" where
up is the positive y-direction and right is the positive x-direction.

I hope I have expressed myself in a clear way.

In advance, I would like to say thank you for your answers.
 
E

Eric P.

Jens said:
Hello,

I have a problem defining a HPGL coordinate system with "normal" orientation
and all 4 axes so
I can use negative coordinates as well. I have uploaded a jpg-picture which
explains in more
detail what it is that I want to do:

See here:
http://img245.imageshack.us/img245/2360/hpglml7.jpg


The following is the relevant part of my HPGL/PCL code:

*c0T
&f32760Y
&f0X
&u600D
%1B
IN;
SP1;
SC0,1.6933,0,-1.6933,2;
IR0,100,0,100;
PU 50,50;
PD -50,50;
PD -50,-50;
PD 50,-50;
PD 50,50;
%1A
&f1X&f9X&f32760y3X

Can anybody tell me how I configure a HPGL coordinate system which makes it
possible
to use negative coordinates. The origin of the coordinate system must always
be the
latest PCL cursor position. And the coordinate system must have "normal
orientation" where
up is the positive y-direction and right is the positive x-direction.

I hope I have expressed myself in a clear way.

In advance, I would like to say thank you for your answers.
It was 1994 when I bought the HP PCL5 Printer Language Technical
Reference Manual and studied the manual and various other books that
came with it.
I did many many exercises using all commands and as a printer I used the
HP Laserjet 4+.

In the mean time I don't know that much anymore but the manual only
mentions Absolute and Relative Pen Movement.

It seems not difficult to draw the box using the available commands or
maybe have your own virtual coordinate system and translate your own
movement values into usable ones before using them.
 
C

Christoph Lindemann

When entering HP/GL you should specify 0 as the default position (Esc%0B)
which set the pen to the the last HP/GL position, or lower left corner when
entering HP/GL for the first time.Or you could move the PCL cursor to the
0,0 position prior to entering HP/GL.

Please read chapters 17 and 18 in the PCL5 Technical Reference Manual.

example:

EscE Reset the printer.
Esc&l2A Set the page size to letter.
Esc&l0O Specify portrait orientation.
Esc&l0E Set top margin to 0.
Esc*p0x0Y Move to position (0,0).
Esc*c5760x7920Y Set picture frame to 8'' x 11''
(size of logical page).
Esc*c0T Set picture frame anchor point to
current PCL cursor position (0,0).
Esc%1B Enter HP-GL/2 mode with the HP-GL/2
cursor or pen at the PCL cursor position.
IN;SP1; Initialize HP-GL/2 command values and
select pen number 1 (black). (The IN
command moves the pen position from the
anchor point to the HP-GL/2 origin, the
lower-left corner of the PCL Picture
Frame.)
SC0,3.3867,0,-3.3867,2; Set-up a user scale with a
user-unit equal to 1/300 inch.
Scale command type 2, the scale
is the ratio of plotter
units/user-units (1016 plotter
units-per-inch/300
dots-per-inch = 3.3867).
The minus 2 Y-value changes the
HP-GL/2 Y direction to match
that of the PCL coordinate
system.
IR0,100,0,100; Place P1 (point 0,0) at the top of the
PCL picture frame.
PU0,0; Lift the pen and move to (0,0) (upper
left corner - since HP-GL/2 coordinate
system now matches PCL coordinate system).
Every subsequent pen move can be specified
using the same coordinate numbers in
either mode. The following commands
demonstrate that the grids are
synchronized.
 
Top