• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Source Code Source cod for creating a sword (1 Viewer)

Currently reading:
 Source Code Source cod for creating a sword (1 Viewer)

Recently searched:

xperon

Member
LV
0
Joined
Jun 11, 2023
Threads
2
Likes
0
Credits
191©
Cash
0$
<!DOCTYPE html>
<html>
<head>
<title>3D Sword</title>
<style>
body {
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
// Create the scene
const scene = new THREE.Scene();

// Create the camera
const camera = new THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.1,
1000
);
camera.position.z = 5;

// Create the renderer
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

// Create the geometry
const geometry = new THREE.BoxGeometry(0.1, 1, 0.1);

// Create the material
const material = new THREE.MeshBasicMaterial({ color: 0x888888 });

// Create the sword mesh
const sword = new THREE.Mesh(geometry, material);

// Add the sword to the scene
scene.add(sword);

// Animation loop
function animate() {
requestAnimationFrame(animate);
sword.rotation.x += 0.01;
sword.rotation.y += 0.01;
renderer.render(scene, camera);
}

// Start the animation loop
animate();
</script>
</body>
</html>
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom