var camera, scene, renderer;
init();
animate();
function init() {
//CREATE CAMERA
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 1, 10000);
camera.position.set(0, 0, 1000);
//CREATE SCENE
scene = new THREE.Scene();
//CREATE LIGHT
var light = new THREE.AmbientLight(0xb5b5b5); // soft white light
scene.add(light);
//ENVIROMENT MAP 'ACTIVE'
var r1 = "https://raw.githubusercontent.com/kgirma/ring/master/";
var urls1 = [
r1 + "pos-x.png",
r1 + "neg-x.png",
r1 + "pos-y.png",
r1 + "neg-y.png",
r1 + "pos-z.png",
r1 + "neg-z.png"
];
//CREATE AN ENVIROMENT CUBE
var textureCube = new THREE.CubeTextureLoader().load(urls1);
textureCube.format = THREE.RGBFormat;
//CREATE MESH
var sphere1 = new THREE.SphereBufferGeometry(400.0, 60, 24, 100, 9);
var torus1 = new THREE.TorusGeometry(400.0, 60, 24, 100, 100);
//...CREATE COLOR FOR MATERIAL
var goldColor = new THREE.Color("rgb(243, 201, 104)");
//CREATE MATERIAL
var goldMaterial = new THREE.MeshBasicMaterial({
specular: 0xffffff,
emissive: 0xffffff,
color: goldColor,
shininess: 100,
metalness: 1,
envMap: textureCube,
});
//CONVERT THE FONT TO JSON USING AN ONLINE TOOL
var loader = new THREE.FontLoader();
loader.load('https://raw.githubusercontent.com/kgirma/ring/master/Milkshake_Regular.json', function(font) {
var textGeometry = new THREE.TextGeometry("Kirusoft Dev.", {
font: font,
size: 120,
height: 15,
curveSegments: 12,
bevelThickness: 1,
bevelSize: 1,
bevelEnabled: true
});
var goldMaterial = new THREE.MeshBasicMaterial({
specular: 0xffffff,
emissive: 0xffffff,
color: goldColor,
shininess: 100,
metalness: 1,
envMap: textureCube,
});
var ring_rg = new THREE.RingGeometry(200, 220, 200, 1, 0, Math.PI * 4);
var ring_mbm = new THREE.MeshBasicMaterial({
color: 0xffff00,
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.