Skip to content

Commit

Permalink
Fix wrong model rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
quadjr committed Oct 9, 2023
1 parent 30985bf commit 0620294
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ About the splat file, please refer [antimatter15](https://github.com/antimatter1
<html>
<head>
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected].11/dist/aframe-gaussian-splatting-component.min.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/aframe-gaussian-splatting-component.min.js"></script>
</head>
<body>
<a-scene renderer="antialias: false" stats>
Expand Down
7 changes: 6 additions & 1 deletion dist/aframe-gaussian-splatting-component.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ AFRAME.registerComponent("gaussian_splatting",{schema:{src:{type:"string",defaul
adjViewMatrix[2][1] *= -1.0;
adjViewMatrix[3][1] *= -1.0;
adjViewMatrix = inverse(adjViewMatrix);
mat4 modelMatrix_fixy = modelMatrix;
mat4 modelMatrix_fixy = inverse(modelMatrix);
modelMatrix_fixy[0][1] *= -1.0;
modelMatrix_fixy[1][0] *= -1.0;
modelMatrix_fixy[1][2] *= -1.0;
modelMatrix_fixy[2][1] *= -1.0;
modelMatrix_fixy[3][1] *= -1.0;
modelMatrix_fixy = inverse(modelMatrix_fixy);
mat4 modelView = adjViewMatrix * modelMatrix_fixy;
vec4 camspace = modelView * center;
Expand Down
2 changes: 1 addition & 1 deletion dist/aframe-gaussian-splatting-component.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected].11/dist/aframe-gaussian-splatting-component.min.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/aframe-gaussian-splatting-component.min.js"></script>
</head>
<body>
<a-scene renderer="antialias: false" stats>
Expand Down
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,13 @@ AFRAME.registerComponent("gaussian_splatting", {
adjViewMatrix[2][1] *= -1.0;
adjViewMatrix[3][1] *= -1.0;
adjViewMatrix = inverse(adjViewMatrix);
mat4 modelMatrix_fixy = modelMatrix;
mat4 modelMatrix_fixy = inverse(modelMatrix);
modelMatrix_fixy[0][1] *= -1.0;
modelMatrix_fixy[1][0] *= -1.0;
modelMatrix_fixy[1][2] *= -1.0;
modelMatrix_fixy[2][1] *= -1.0;
modelMatrix_fixy[3][1] *= -1.0;
modelMatrix_fixy = inverse(modelMatrix_fixy);
mat4 modelView = adjViewMatrix * modelMatrix_fixy;
vec4 camspace = modelView * center;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aframe-gaussian-splatting-component",
"version": "0.0.11",
"version": "0.0.12",
"description": "This component is an A-Frame implementation of real-time rendering for '3D Gaussian Splatting for Real-Time Radiance Field Rendering'",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 0620294

Please sign in to comment.