Skip to content

Commit

Permalink
coin moving
Browse files Browse the repository at this point in the history
  • Loading branch information
VarshaShaheen committed Jan 12, 2025
1 parent 20dc5ee commit c31b5ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
import { VRButton } from 'three/examples/jsm/webxr/VRButton';
import * as THREE from 'three';
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";

import { letterPositions } from './utils/utils';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
let coinObject; // To store the loaded coin

camera.position.set(0, 1, 5); // Set the camera position to ensure it's not inside the cube

const letterPositions = {
'A': { x: -0.22, z: -0.02 }, 'B': { x: -0.18, z: -0.03 }, 'C': { x: -0.14, z: -0.04 },
'D': { x: -0.11, z: -0.05 }, 'E': { x: -0.07, z: -0.06 }, 'F': { x: -0.04, z: -0.065 },
'G': { x: -0.01, z: -0.06 }, 'H': { x: 0.04, z: -0.05 }, 'I': { x: 0.08, z: -0.045 },
'J': { x: 0.103, z: -0.04 }, 'K': { x: 0.14, z: -0.035 }, 'L': { x: 0.18, z: -0.04 },
'M': { x: 0.225, z: -0.035 },
'N': { x: -0.22, z: 0.02 }, 'O': { x: -0.185, z: 0.01 }, 'P': { x: -0.145, z: 0.01 },
'Q': { x: -0.11, z: 0.01 }, 'R': { x: -0.07, z: -0.015 }, 'S': { x: -0.03, z: -0.015 },
'T': { x: 0.0, z: -0.015 }, 'U': { x: 0.04, z: -0.015 }, 'V': { x: 0.075, z: -0.015 },
'W': { x: 0.12, z: 0.0 }, 'X': { x: 0.17, z: 0.0 }, 'Y': { x: 0.2, z: 0.01 },
'Z': { x: 0.23, z: 0.02 }
};

const word = "VARSHA".toUpperCase();

camera.position.set(0, 1, 5);

const word = "Rohit".toUpperCase();
let currentIndex = 0;
const constantY = 0.1; // Y remains constant

Expand Down
12 changes: 12 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
// Place holder
export const a = 0;
export const letterPositions = {
'A': { x: -0.22, z: -0.02 }, 'B': { x: -0.18, z: -0.03 }, 'C': { x: -0.14, z: -0.04 },
'D': { x: -0.11, z: -0.05 }, 'E': { x: -0.07, z: -0.06 }, 'F': { x: -0.04, z: -0.065 },
'G': { x: -0.01, z: -0.06 }, 'H': { x: 0.04, z: -0.05 }, 'I': { x: 0.08, z: -0.045 },
'J': { x: 0.103, z: -0.04 }, 'K': { x: 0.14, z: -0.035 }, 'L': { x: 0.18, z: -0.04 },
'M': { x: 0.225, z: -0.035 },
'N': { x: -0.22, z: 0.02 }, 'O': { x: -0.185, z: 0.01 }, 'P': { x: -0.145, z: 0.01 },
'Q': { x: -0.11, z: 0.01 }, 'R': { x: -0.07, z: -0.015 }, 'S': { x: -0.03, z: -0.015 },
'T': { x: 0.0, z: -0.015 }, 'U': { x: 0.04, z: -0.015 }, 'V': { x: 0.075, z: -0.015 },
'W': { x: 0.12, z: 0.0 }, 'X': { x: 0.17, z: 0.0 }, 'Y': { x: 0.2, z: 0.01 },
'Z': { x: 0.23, z: 0.02 }
};

0 comments on commit c31b5ab

Please sign in to comment.