Skip to content

Commit 4434e55

Browse files
committed
label always face camera
1 parent 3dc81d7 commit 4434e55

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fs_out_flat => " $FRAG_OUT = in_diffuse;\n",
152152
vs_in => " vec3 the_position = position;\n",
153153
vs_in_offset_decl => "$VS_IN vec3 offset;\n",
154154
vs_do_offset => " the_position += offset;\n",
155-
vs_do_toffset => " the_position += vec3(toffset.x, 0, toffset.y);\n",
155+
vs_do_toffset => " gl_Position += vec4(toffset, 0, 0);\n",
156156
vs_out => " gl_Position = uMVP * vec4(the_position, 1);\n",
157157
vs_out_light => <<'EOF',
158158
vNormal = normalize(uNormalMatrix * normal);
@@ -486,7 +486,7 @@ sub _font_setup {
486486
my $vertex_shader = join '', @SHADERBITS{qw(version
487487
vs_in_position_decl vs_in_toffset_decl
488488
vs_in_texcoord_decl vs_out_texcoord_decl u_matrix_decl
489-
main_start vs_in vs_do_toffset vs_out vs_out_texcoord main_end
489+
main_start vs_in vs_out vs_do_toffset vs_out_texcoord main_end
490490
)};
491491
my $fragment_shader = join '', @SHADERBITS{qw(version
492492
fs_in_texcoord_decl fs_out_fragcolour_decl u_tex_decl
@@ -502,8 +502,8 @@ sub togl_setup {
502502
$points //= $this->{Points}; # as Labels is used in Graph
503503
my $numchars = $FONT{numchars};
504504
my $vert_template = PDL->new(PDL::float, [0,1], [0,0], [1,1], [1,0]);
505-
my $dwidth = $PDL::Graphics::TriD::Window::DEFAULT_WIDTH / 1.5;
506-
my $dheight = $PDL::Graphics::TriD::Window::DEFAULT_HEIGHT / 1.5;
505+
my $dwidth = $PDL::Graphics::TriD::Window::DEFAULT_WIDTH / 4;
506+
my $dheight = $PDL::Graphics::TriD::Window::DEFAULT_HEIGHT / 4;
507507
$vert_template *= PDL::float(1 / $dwidth, $FONT{heightpix} / $dheight);
508508
my @codes = map [map ord, split //], @{ $this->{Strings} };
509509
my ($v2, @v1, @v3) = PDL->null;

0 commit comments

Comments
 (0)