background preloader

Javascript et 3D

Facebook Twitter

Document.execCommand() - Web APIs. This article is in need of a technical review.

Document.execCommand() - Web APIs

This article is in need of an editorial review. When an HTML document has been switched to designMode, the document object exposes the execCommand method which allows one to run commands to manipulate the contents of the editable region. Most commands affect the document's selection (bold, italics, etc.), while others insert new elements (adding a link) or affect an entire line (indenting). When using contentEditable, calling execCommand() will affect the currently active editable element. SyntaxEdit bool = document.execCommand(aCommandName, aShowDefaultUI, aValueArgument) Return value. Getting Started with Node.js on Heroku.

Introduction This tutorial will have you deploying a Node.js app in minutes.

Getting Started with Node.js on Heroku

Hang on for a few more minutes to learn how it all works, so you can make the most out of Heroku. The tutorial assumes that you have a free Heroku account, and that you have Node.js and npm installed. Canvas, images and pixels - things I learned building an 8 bit logo generator. During my time off from work, I went back to one of my old passions: pixeling stuff on a Commodore 64.

Canvas, images and pixels - things I learned building an 8 bit logo generator

Many years ago (15, to be exact) I created a logo generator that allows you to put together a logo from a charset pixeled on a C64. I wrote this old version in PHP using GD and moved it to use canvas and work client-side some time ago. Now I thought it would be fun to brush this up and play with it. So I created a much more bells and whistles version. You can see the "Logo-O-Matic" online (and the source is of course available on GitHub). The features are pretty nice: Choose from 58 fonts (and counting) Create a logo using variable letter and word spacing Inspect the logo (zooming, seeing the colour under the cursor) Change the colours of the logo Save the logo in original or double size as a PNG. In this article, I will explain how I did some of that, repeat some canvas basics and show simpler examples of the editor features.

Pixel manipulation with canvas. Until now we haven't looked at the actual pixels of our canvas.

Pixel manipulation with canvas

With the ImageData object you can directly read and write a data array to manipulate pixel data. We will also look into how image smoothing (anti-aliasing) can be controlled and how to save images from your canvas. The ImageData object. MotionEmotion by Karen Peng, Jason Sigal. HTML5 Canvas camera/viewport - how to actally do it? Viewport. Images: 2d Graphics - javaScripting.com. 10 Cool JavaScript Drawing and Canvas Libraries. JavaScript/web designers and developers and can take advantage of these JavaScript Drawing and Canvas libraries to add graphics drawing functionality to their web applications or websites.

10 Cool JavaScript Drawing and Canvas Libraries

Have fun! Matter.js - a 2D rigid body JavaScript physics engine. Développer des jeux en HTML5 et JavaScript - S. Ronce. Alors que les navigateurs sont en constante évolution pour optimiser l'exécution de jeux, HTML5 propose de nouvelles balises et API JavaScript pour gérer la vidéo et l'audio, dessiner en 2D et 3D.

Développer des jeux en HTML5 et JavaScript - S. Ronce

De quoi alimenter l'explosion du marché des jeux web, natifs et sociaux, notamment sur les smartphones et tablettes. A Virtual Camera for Interactive Documentaries, Inspired by Side-Scrolling Video Games. View the demo » | Demo source code »Full documentation and source code » One of the best ways to innovate is to borrow conventions from other fields.

A Virtual Camera for Interactive Documentaries, Inspired by Side-Scrolling Video Games

Often, those working in another industry or medium have solved problems that you may be stuck on or didn’t even know you had. For interactive media, I find that video games are a great place to look for ideas. It’s a field that’s been tackling problems of story structure, user controls and dynamic aesthetics for over four decades. A great example of such an idea is the way video games handle automatic control of a virtual camera, specifically in two-dimensional side-scrolling games. The developer of “Insanely Twisted Shadow Planet” explains the game’s camera control logic.

How It Works The virtual camera concept can be applied to any interaction where there is a user-controlled cursor, along one or more axes within a space representing data or other media, analogous to a “player” character in a game. Always keep the “player” in view. Demo. A suite of JavaScript libraries and tools designed for working with HTML5. Three.js - examples. Easy Way To Integrate Video, or even WebCam, in Your Texture with THREEx.VideoTexture Game Extension for THREE.js. Three.js - documentation - Manual - Creating a scene.

Canvas 3D (WebGL) plus facile avec Three.js. Nous avons tous déjà vu des sites de grandes marques nous en mettant plein la vue avec des animations 3D interactives, ou des démonstrations technologiques qui font rêver.

Canvas 3D (WebGL) plus facile avec Three.js

On pense ici à quelques berlines allemandes parfaitement modélisées qu’il est possible d’inspecter sous tous ses angles avec un simple mouvement de la souris... Bien souvent développées en Flash avec la librairie Papervision3D ces animations en jettent un max, mais restent dépendantes du plug-in d'Adobe qui est de moins en moins populaire et "incompatible" tablette et smartphone. Three.js - Javascript 3D library. Paper.js. Introduction au jargon de la 3D et à WebGL.

Le monde de la 3D suscite souvent l’admiration et la curiosité des gens.

Introduction au jargon de la 3D et à WebGL

Pourtant, lorsque l’on souhaite se lancer dans l’aventure, on a l’impression que ce monde nous reste fermé et obscur. 3Dbop, une visionneuse WebGL Collada. Une problématique récente a vu le jour avec la venue de WebGL : comment utiliser dès à présent cette technologie sans devoir ré-apprendre un nouveau langage complexe, et sans devoir tout coder "à la main" ?

3Dbop, une visionneuse WebGL Collada

Ne trouvant aucun système permettant d'utiliser de manière facile et satisfaisante la technologie WebGL, Nicolas Barre a décidé de créer sa propre visionneuse d'objets 3D. 3Dbop est une visionneuse d'objets 3D pour le web basée sur le moteur Open Source CubicVR. Elle est conçue pour afficher plus facilement des objets 3D créés avec votre logiciel favori (SketchUp, Blender...) dans les navigateurs web compatibles avec la technologie WebGL. Fonctionnement Créez votre modèle avec votre logiciel favori (SketchUp, Blender...) WebGL Collada viewer. Babylon.js.

Premier pas en 3D avec WebGL et Babylon.js. Faire de la 3D directement dans son navigateur sans aucun plugin est possible grâce à WebGL. Je vous propose de faire un peu de JavaScript et par la même occasion de créer une scène en 3D avec le moteur Babylonjs. L’avantage de Babylonjs est de proposer par défaut un support de tous les navigateurs récents, y compris Internet Explorer 11, il prend aussi en charge les écrans tactiles.