What’s on our mind?

Collection of articles, design, site, and resources made by designers and publisher @Menu View

2022/04 15건이 검색되었습니다.

해바라기

* index22 class THREEScene { constructor(container = document.body) { this.container = container; this.init(); } init() { this.setup(); this.camera(); this.addToScene(); this.createParticles(); this.createBackground(); this.eventListeners(); this.render(); this.animate(); } setup() { this.scene = new THREE.Scene(); this.renderer = new THREE.WebGLRenderer({ antialias: true }); this.renderer.setSi..

더 보기

기념일은 아니지만.

index21 class Canvas { constructor() { this.scrollY = 0; this.mouse = new THREE.Vector2(0, 0); this.w = window.innerWidth; this.h = window.innerHeight; this.renderer = new THREE.WebGLRenderer({antialias: true}); this.renderer.setSize(this.w, this.h); this.renderer.setPixelRatio(window.devicePixelRatio); this.renderer.setClearColor(0x0b0115); const container = document.getElementById("myCanvas");..

더 보기

모션 이펙트

* index20 const container = document.getElementById("container"); //화면 생성 const scene = new THREE.Scene(); scene.background = new THREE.Color(0x000022); //카메라 설정 const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 500); camera.position.z = 300; camera.position.y = 0; //조명 설정 const pointLight = new THREE.PointLight(0xffffff, 1); pointLight.position.set(-50, 1..

더 보기

new THREE.Vector2()

* index19 let frag = ` vec4 abyssColor = vec4(1, 0.8, 0.4, 0); vec4 tunnelColor = vec4(2, 0.9, 0.3, 1); uniform float time; uniform vec2 resolution; void main() { vec2 uv = ( gl_FragCoord.xy - .6 * resolution.xy) / resolution.y * 0.3; float r = length(uv); float y = fract( r / 0.05 / ( r - 0.02 ) + time * 1.); y = smoothstep( 0.01, 4., y ); float x = length(uv); x = smoothstep( 0.5, .01, x ); gl..

더 보기

위성

* index18 //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000); camera.position.set(1, 6, 5); camera.lookAt(new THREE.Vector3(0,0,0)); //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); d..

더 보기

돌아라~

* index17 //변수 설정 const fullCircle = 2 * Math.PI; const timing = 10; let materialFirstCylinder, materialSecondCylinder, materialThirdCylinder, materialFourthCylinder; //화면 생성 const scene = new THREE.Scene(); scene.background = new THREE.Color(0x000000); //카메라 설정 const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000); camera.position.z = 350; camera.positi..

더 보기

targetMeshScale

index16 class ThreeText { constructor( options = { appContainerSelector: "[data-app-container]" } ) { this.options = options; this.appContainer = document.querySelector( this.options.appContainerSelector ); this.iter = 0; // THREE items this.renderer; this.camera; this.scene; this.controls; this.imageTexture; this.uniforms; this.geometry; this.mesh; this.font; this.targetMeshScale = 1; // 마우스 th..

더 보기

AmbientLight

//변수 설정 const params = { rx: 0, ry: 0, rz: 0, } const degreesToRadians = (degrees) => { return degrees * (Math.PI / 180) } //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000); camera.position.z = 5 //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window...

더 보기

planeGeometry

* index14 const heatVertex = ` uniform sampler2D heightMap; uniform float heightRatio; varying vec2 vUv; varying float hValue; void main() { vUv = uv; vec3 pos = position; hValue = texture2D(heightMap, vUv).r; pos.y = hValue * heightRatio; gl_Position = projectionMatrix * modelViewMatrix * vec4(pos,1.0); } `; var heatFragment = ` varying float hValue; vec3 heatmapGradient(float t) { return clamp..

더 보기

비치냐?

index13 //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 1000); camera.position.setScalar(4); camera.lookAt(scene.position); //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setClearColor(0x44bbaa); renderer.setPixelRatio(windo..

더 보기

등아 날아라!

* index12 //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.set(0, -6, 20); //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setClearColor(0x201005); renderer.setPixelRatio(window.devicePixelRatio); docu..

더 보기

GSAP Scale

var mouseX; var mouseY; //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 400; //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); document.body.appendChild(rende..

더 보기

뚞뚞뚞뚞 떨어진다.

var Vector2 = (function() { function Vector2(x, y) { this.x = x || 0; this.y = y || 0; } return Vector2; })(); Vector2.prototype.add = function(addend) { this.x += addend.x; this.y += addend.y; }; var RainDrop = (function() { function RainDrop(parent) { this.size = 3; this.parent = parent; this.init(); } return RainDrop; })(); RainDrop.prototype.init = function() { this.life = 0; this.ttl = Math..

더 보기

fromBufferAttribute

* index10.html //화면 생성 const scene = new THREE.Scene(); //카메라 설정 const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 1000); camera.position.set(2, 3, 5); //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); document.body.appendChild(renderer.do..

더 보기

IcosahedronGeometry

** index9.html //화면 생성 const scene = new THREE.Scene(); scene.fog = new THREE.Fog(0x3d0764, 20, 25); //카메라 설정 const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 25; //렌더링 설정 renderer = new THREE.WebGLRenderer({antialias:true, alpha: true}); renderer.setClearColor(0x3d0764); renderer.setSize(window.innerWidth, window.innerHeight)..

더 보기