Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Esguerra Montana
Web AR
Commits
307b62ed
Commit
307b62ed
authored
1 year ago
by
Esguerra Montana
Browse files
Options
Download
Email Patches
Plain Diff
Update index.html
parent
076096a3
Pipeline
#9440
passed with stage
in 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+11
-10
public/index.html
with
11 additions
and
10 deletions
+11
-10
public/index.html
+
11
-
10
View file @
307b62ed
...
@@ -33,7 +33,8 @@ async function activateXR() {
...
@@ -33,7 +33,8 @@ async function activateXR() {
// Create the torus geometry
// CREATE TORUS GEOMETRY
const
torusRadius
=
1
;
const
torusRadius
=
1
;
const
torusTube
=
0.4
;
const
torusTube
=
0.4
;
const
torusSegments
=
64
;
const
torusSegments
=
64
;
...
@@ -41,24 +42,21 @@ async function activateXR() {
...
@@ -41,24 +42,21 @@ async function activateXR() {
// Create a metallic gold material
// Create a metallic gold material
const
goldMaterial
=
new
THREE
.
MeshPhysicalMaterial
({
const
goldMaterial
=
new
THREE
.
MeshPhysicalMaterial
({
color
:
0xFFD700
,
// Gold color
color
:
0xFFD700
,
metalness
:
1.0
,
// Fully metallic
metalness
:
1.0
,
roughness
:
0.4
,
// Adjust for shininess
roughness
:
0.4
,
clearcoat
:
0.2
,
// Add clear coat for a polished effect
clearcoat
:
0.2
,
clearcoatRoughness
:
0.1
clearcoatRoughness
:
0.1
});
});
// Create the torus mesh
// Create the torus mesh
const
torusMesh
=
new
THREE
.
Mesh
(
torusGeometry
,
goldMaterial
);
const
torusMesh
=
new
THREE
.
Mesh
(
torusGeometry
,
goldMaterial
);
// Scale the torus mesh to make it smaller
// Scale the torus mesh to make it smaller
torusMesh
.
scale
.
set
(
0.2
,
0.2
,
0.2
);
torusMesh
.
scale
.
set
(
0.2
,
0.2
,
0.2
);
// Add the torus mesh to the scene
// Add the torus mesh to the scene
scene
.
add
(
torusMesh
);
scene
.
add
(
torusMesh
);
//CREATE TETRAHEDRON GEOMETRY
// Color of the tetrahedron geometry.
// Color of the tetrahedron geometry.
//const material = new THREE.MeshPhysicalMaterial({ color: 0xC70039, roughness: 0.5, metalness: 0.5, clearcoat: 1.0, clearcoatRoughness: 0.1 });
//const material = new THREE.MeshPhysicalMaterial({ color: 0xC70039, roughness: 0.5, metalness: 0.5, clearcoat: 1.0, clearcoatRoughness: 0.1 });
...
@@ -72,6 +70,8 @@ async function activateXR() {
...
@@ -72,6 +70,8 @@ async function activateXR() {
// Add the mesh to the scene
// Add the mesh to the scene
//scene.add(tetrahedron);
//scene.add(tetrahedron);
//CREATE A HOUSE ROTATING
/*
/*
// Define the vertices
// Define the vertices
var vertices = new Float32Array([
var vertices = new Float32Array([
...
@@ -126,9 +126,10 @@ async function activateXR() {
...
@@ -126,9 +126,10 @@ async function activateXR() {
wallMesh.position.set(0, -1.5, -3);
wallMesh.position.set(0, -1.5, -3);
roofMesh.position.set(0, -1.5, -3);
roofMesh.position.set(0, -1.5, -3);
// Add the
meshes
to the scene
// Add the
house
to the scene
scene.add(wallMesh);
scene.add(wallMesh);
scene.add(roofMesh);*/
scene.add(roofMesh);*/
// Set up the WebGLRenderer, which handles rendering to the session's base layer.
// Set up the WebGLRenderer, which handles rendering to the session's base layer.
const
renderer
=
new
THREE
.
WebGLRenderer
({
const
renderer
=
new
THREE
.
WebGLRenderer
({
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment