Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

vec4() initialization wrong

dave1707dave1707 Mod
edited February 2013 in Bugs Posts: 9,586

.@Simeon There is a error with vec4() initialization. If a parameter isn't supplied, the default should be 0. See the example below.

function setup()     print( vec2() )     print( vec3() )     print( vec4() ) end

This results in:

(0.000000, 0.000000)

(0.000000, 0.000000, 0.000000)

(0.000000, 0.000000, 0.000000, 1.000000)


  • edited February 2013 Posts: 489

    Hello @dave1707. This has been the default result for vec4() for some time. I believe it is explained by the fact that vec4 userdata is used to represent three-dimensional points with homogeneous coordinates. I've added some information to the wiki.

  • dave1707dave1707 Mod
    Posts: 9,586

    Thanks @mpilgrem. I wasn't sure if it was supposed to be like that.

Sign In or Register to comment.