View Issue Details

IDProjectCategoryView StatusLast Update
0026305RunnerFunctionsPublic2018-10-29 09:47
ReporterStewart BishopAssigned ToAntanas Budvytis 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
PlatformHTML5OSOS Version
Product VersionPre-2.1.3 
Target Version2.2.1Fixed in Version2.2.1 
Summary0026305: HTML5: Matrices (other than matrix_world) returned from "matrix_get" are wrong unless set with "matrix_set"
DescriptionIn testing 3D, I have found that the matrix_get functions seem to be broken on HTML5 - seemingly for both 2D and 3D.

Observing the results of the sample below, the problems with HTML5 are quite prelevant when compared to the Windows target.
matrix_world seems to be completely correct in HTML5.
The first obvious concern is that the matrices do not seem to change between 2D and 3D projections in HTML5 - it treats it as though the 3D view was never established, even though it clearly has a visual effect. This could be a bug with the d3d_set_projection[_*] not updating the internal matrices correctly.
The second is that the projection and view matrices seem to have swapped "slots" - "view" in HTML5 seems to match "projection" on Windows, and "projection" in HTML5 seems to match "view" on Windows, which causes problems with multiplying matrices in general.
"matrix_set" seems to work correctly - it updates the appropriate slots (matrix_set(matrix, matrix_projection) does result in the output Projection matrix being the same as "matrix", meaning the retrieval works as expected) - on top of this, the matrices set do not change after the projection call.
These tests seem to suggest that the problem lies with projection setting - the automatic views set the (accessible, since rendering seems correct) projection and view matrices the wrong way around, and none of the d3d_set_projection[_*] functions update them at all.
To clarify, these problems only seem to occur in the HTML5 export.

Sample table of printouts (For quick reference):

Windows target:

Print custom Matrix (set to world
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]

Print 2D projection Matrices
World
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]
View
[1, 0, 0, -512, ]
[0, 1, 0, -160, ]
[0, 0, 1, 16000, ]
[0, 0, 0, 1, ]
Projection
[0.00, 0, 0, -0.00, ]
[0, -0.01, 0, 0.00, ]
[0, 0, 0.00, -0.00, ]
[0, 0, 0, 1, ]

Print 3D projection Matrices
World
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]
View
[1, 0, 0, 0, ]
[0, -0.45, 0.89, 0, ]
[0, -0.89, -0.45, 143.11, ]
[0, 0, 0, 1, ]
Projection
[0.49, 0, 0, -0.00, ]
[0, 1.57, 0, 0.00, ]
[0, 0, 1.00, -1.00, ]
[0, 0, 1, 0, ]

HTML5:

Print custom Matrix (set to world)
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]

Print 2D projection Matrices
World
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]
View
[0.00, 0, 0, 0, ]
[0, 0.01, 0, 0, ]
[0, 0, 0.00, -0.00, ]
[0, 0, 0, 1, ]
Projection
[1, 0, 0, -512, ]
[0, 1, 0, -160, ]
[0, 0, 1, 16000, ]
[0, 0, 0, 1, ]

Print 3D projection Matrices
World
[0.73, 0.46, -0.84, 12, ]
[-0.15, 1.80, 0.86, 32, ]
[2.37, -0.62, 1.72, 54, ]
[0, 0, 0, 1, ]
View
[0.00, 0, 0, 0, ]
[0, 0.01, 0, 0, ]
[0, 0, 0.00, -0.00, ]
[0, 0, 0, 1, ]
Projection
[1, 0, 0, -512, ]
[0, 1, 0, -160, ]
[0, 0, 1, 16000, ]
[0, 0, 0, 1, ]
Steps To Reproduce1) Run sample on Windows
2) Run sample on HTML5
3) Compare the output
Tagsfunctions, html5, Runner
1.4 Found In1.99.533
2.x Runtime Found In
2.x Runtime Verified In2.2.1.268

Activities

Stewart Bishop

2017-04-25 11:41

Adminstrator  

brokenHTML5matrices.gmz (19,284 bytes)