Skip to content

Commit

Permalink
Grid is transparent and added y-axis
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Oct 18, 2021
1 parent 1712d7e commit 36dbc98
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Binary file added img/grid_alpha_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/structural/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ class View extends Component {
<a-grid height="53.33" width="53.33" position="-0.5 -0.26 -0.5" scale="1.5 1.5 1.5" gridmaterial/>
<a-tube path="-35 -0.2 0, 35 -0.2 0" radius="0.05" material="color: red" basicmaterial></a-tube>
<a-tube path="0 -0.2 -35, 0 -0.2 35" radius="0.05" material="color: blue" basicmaterial></a-tube>
<a-tube path="0 -35 0, 0 35 0" radius="0.05" material="color: green" basicmaterial></a-tube>
<a-text
color="#555"
rotation="0 0 0"
Expand All @@ -301,7 +302,7 @@ class View extends Component {
<a-text
color="#555"
rotation="0 90 90"
position="0 .1 0"
position=".1 .1 0"
side="double"
value=" Y + "></a-text>
</Fragment>
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const DEF_SETTINGS = {
floorColor: "#222",
camConfig: 0,
showCoordHelper: true,
showFloor: false,
showFloor: true,
cameraPosition: "0 1.6 3",
viewOnly: false,
defaultLight: true,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe("Scene Reducer", () => {
floorColor: "#222",
camConfig: 0,
showCoordHelper: true,
showFloor: false,
showFloor: true,
cameraPosition: "0 1.6 3",
viewOnly: false,
defaultLight: true,
Expand Down
5 changes: 3 additions & 2 deletions src/utils/AFramePhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ AFRAME.registerComponent("gridmaterial",{
default:""
},
init: function(){
const texture = new THREE.TextureLoader().load("https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/assets/grid.png");
const texture = new THREE.TextureLoader().load("/img/grid_alpha_0.png");
texture.repeat = new THREE.Vector2(75,75);
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;

this.el.getObject3D("mesh").material = new THREE.MeshBasicMaterial({
map: texture
map: texture,
transparent: true
});
}
});
Expand Down

0 comments on commit 36dbc98

Please sign in to comment.