Pode's Recent Forum Activity

  • damainman : I'm working on a webgl effect for that. It's not going to work on mobile where there's no (i.e. iOS), but it's a start...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here's a design problem I want to solve the simple way.

    To illustrate it, imagine I have a Sprite named "triangle".

    On one vertex, I pin a tiny Sprite. I pin another tiny Sprite on another vertex.

    What I want is that if I set the position of one of those tiny Sprite, the pinned triangle follows it in place. Furthermore, I want to set the position of the other tiny Sprite, and be sure that the previous tiny Sprite is still there as a constraint (making, for example, the triangle rotate around it to respect both constraints).

    I don't want to code something like an Inverse Kinematic plugin to solve those constraints. Is there an easy way to do without it ?

    Is there a way to pin an object to two other objects at the same time ?

  • Vitae : the OR condition is the right one.

    In fact, in your example, I'm pretty sure that, if the "Rotation = 0" is true, then the Rotation is set to 1, and on the following one, "Rotation = 1" is true. A classical example where you need to debounce your event.

  • lokesen : you can't activate HTML5 fullscreen API and browser zoom at the same time. So it's going to break one basic functionnality of C2.

  • I ported a quick GLSL shader to get bilinear resize (zoom & shrink) on Sprites when you need it outside of the regulard browser resize :

    <img src="https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/demo.png" border="0">

    You can get some "smoothing" effect when you resize your image with it :

    <img src="https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/beforeafter.png" border="0">

    The dev page is there : http://www.scirra.com/forum/topic59992_post368714.html#368714, you can now the effect of the various parameter on it.

    The demo : https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/index.html

  • Today, HTML5-compatible browsers already provide bilinear filtering on <canvas> and in WebGL for images when you resize the graphics.

    However, I encountered a situation in which I need a bilinear resize of a Sprite, on only that one. Javascript is too slow to do it realtime, so I implemented that in a WebGL shader.

    <img src="https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/demo.png" border="0">

    This shader is a quick port to C2 of the GLSL shader from there :

    http://www.gamerendering.com/2008/10/05/bilinear-interpolation/

    The bilinear filter works in both directions (image magnification and shrinking).

    It works with 4 parameters :

    <img src="https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/parameters.png" border="0">

    The Texture Width Size is the new width you want to have, Texture HeightSize is the new height, the X pixel size must be set to 1.0/Texture Width, and the same for Y pixel size (1.0/Texture Height).

    You get that kind of after/before effect (however no hope of regrowing your hairs back with a shader...):

    <img src="https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/beforeafter.png" border="0">

    The demo : https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/index.html

    The effect .zip archive : https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/pode_bilinear_filter.1.0.zip (put it inside the effects folder !

    The .capx : https://dl.dropbox.com/u/1412774/WebGLBilinearEffectDemo/WebGLBilinearEffectDemo.capx

  • kenhes : no. You need to use an .emf or .wmf to .svg converter before using this plugin.

  • : the thing is it's up to each browser engine to decide how it's going to render a "FileReader". I'll try to see if I can force a something else than a DOM element <img src="smileys/smiley2.gif" border="0" align="middle" />.

  • inkBot srealist : I'm planning to add the "shadow" part when I have the time, and combine it with multiple light sources.

  • Joe7 : to make screenshot of a webgl canvas, you need to have

    preserveDrawingBuffer: true

    set.

    Since I suppose you need it set from the C2 engine, perhaps you can ask Ashley if he can do something like this :

    var canvas = document.getElementById("canvas");

    var gl = getWebGLContext(canvas,{preserveDrawingBuffer: true});

    to make it works.

  • johnELLIS : for the moment, it's best to use it to display pre-drawn SVG files.

  • The problem with SVG is it's support inside the <canvas> tag.

    On FF, you can draw a svg inside a canvas, and retrieve it as a raster image, via toDataURL().

    Chrome (and WebKit in general) has a browser-wide bug : when you draw a SVG on a canvas, the canvas is set as 'tainted', and you can't retrieve the raster image.

    Since everything in C2 is based on canvas, you need to work with it. That's why my SVG plugin is on hold, I'm waiting for an update on the WebKit side...

Pode's avatar

Pode

Member since 3 Sep, 2011

Twitter
Pode has 11 followers

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies