3D sphere with texture in Canvas (HTML5) - html

Can we bind texture with Canvas (HTML5) 3D Sphere ?
I am referring to this example - http://www.bitstorm.it/blog/en/2011/05/3d-sphere-html5-canvas/
Thanks,
EDIT :
alternate link -
http://sebleedelisle.com/2011/02/html5-canvas-3d-particles-uniform-distribution/

Yes it is possible just like http://www.nihilogic.dk/labs/canvas3dtexture_0.2/ . But if you actually looking for 3d texture you must use WEBGL texture
A nice introduction can be found in Learning WebGL

Related

Which shader to use in order to render a mesh as is?

I am using GL 2.0 (in order to display pictures that are not power of 2), and I am trying to simply render a mesh (that displays some triangles).
When using GL 1.0, I didn't have any problem, but now, I have to pass a ShaderProgram object as a parameter.
How can I make it work like it would in GL 1.0?
Should I make a shader that simply does nothing?
You have to use a vertex shader to convert world space coordinates into screen space coordinates. And you need a pixel shader to look up texture coordinates for each rendered pixel of your quad.
Look at the shaders that Libgdx uses for its SpriteBatch, they are pretty minimal texture-a-quad shaders. You can literally use SpriteBatch.createDefaultShader() to get them or just use them as inspiration for your own shaders.
The libgdx wiki page on shaders already contains an example code for a simple shader:
https://github.com/libgdx/libgdx/wiki/Shaders
I assume it's basically the same as the createDefaultShader() as in P.T.'s answer...
Hope it helps...

Action Script: Drawing on video

I was wondering how to draw over a video like this.
http://www.bannerblog.com.au/2009/06/burger_king_sharpie.php
I'm not sure that in the example is drawing process over video. As for me It's a 3d model with video background. And you could sync prerecorded states with 3d object transformations (position, rotation, mesh transformations), or create well textured object.
Here for your tutorial how to draw over the 3D objects
Easy! Use Adobe After Effects (or any number of other compositing programs).

Starling 3D rotation

Is there a way to rotate an object (plain graphic) around it's X axis using Starling (stage3D)?
There was rotationXYZ in "standard" Flash (stage) to do this and I am looking for similar solution.
At the moment, these features are not implemented (see forum page) .But, you can play with transformationMatrix of Starling's DisplayObject. Or if you are rendering your texture on runtime from ordinary Flash DisplayObject you can first give rotation to DisplayObject instance and then turn it into texture , very elegant..

Away3d Camera Path

How to know the coordinates of the path if you know the azimuthal angle. I wanna move my camera around an object in away 3d.
Move camera in Spherical coordinate system by Interpolating from starting azimuthal angle to target - it will be your trajectory.
You can convert from\to Cartesian coordinate system to retrive\pass current coordinate to away3d renderer.
You all so may want to use non-linear camera acceleration(for more realistic feel) it can be implemented with Bézier curves
PS. I will be thankful if your publish you realisation because i will need this functional in my next project. You will save me a lot of time :)
Or just use translation and rotation methods that camera inherits from Object3D it's all covered in Away3D example projects. Allso Away3D has path helper package

What is "drawing context" exactly? What is the role of getcontext() method?

What is getContext() method and what is drawing context exactly? why we always pass the string 2d to the getContext() method?
Context is a way to choose what you are going to do with your canvas.
For moment you can use getContext for 2d (2dcanvas) or for 3d (WebGL).
HTML5 Specification say's about getContext :
"Returns an object that exposes an API for drawing on the canvas. The first argument specifies the desired API. Subsequent arguments are handled by that API."
You can find specifications for each API there :
https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-getcontext
It is also good to know that "webgl" is the correct name for API but for moment, as it is experimental you should use "experimental-webgl" to start creating WebGL content
In Computer graphics, a drawing context is an abstraction (class/object) that encapsulates how you are going to draw stuff.
At a 100k foot level, computer graphics is about converting drawing commands to pixels (image). How you go from commands to pixels is what the graphics pipeline is all about (very broad and deep subject). A drawing context exposes drawing methods and properties to achieve this.
Example of a drawing commands: drawLine, drawPath, drawRect (you get the idea).
Example of drawing properties: fill color, stroke color, stroke style, font size, clipping region etc
In the context (pardon the pun) of web, you have two drawing contexts - canvas for 2d drawing and and webgl for 3d drawing.