Comments for words are toys http://www.wordsaretoys.com and so on... Fri, 24 Apr 2015 02:43:40 +0000 hourly 1 http://wordpress.org/?v=4.3.1 Comment on roll that camera, zombie: rotation and conversion from YV12 to YUV 420 Planar by chris http://www.wordsaretoys.com/2013/10/25/roll-that-camera-zombie-rotation-and-coversion-from-yv12-to-yuv420planar/#comment-834 Fri, 24 Apr 2015 02:43:40 +0000 http://www.wordsaretoys.com/?p=543#comment-834 Thanks Zenith! I haven’t worked with this code in ages, but I think you’d have to do something like

int w = width, h = height;
int wo = height, h0 = width; // add this

Then, for every transformation to output, use the (wo, ho) in place of (w, h). Example:

output[wo * yo + xo] = input[wo * yi + xi];

Sorry, I know it’s a little vague. Play around and see what you get. Good luck!

]]>
Comment on roll that camera, zombie: rotation and conversion from YV12 to YUV 420 Planar by Zenith http://www.wordsaretoys.com/2013/10/25/roll-that-camera-zombie-rotation-and-coversion-from-yv12-to-yuv420planar/#comment-822 Thu, 23 Apr 2015 10:25:49 +0000 http://www.wordsaretoys.com/?p=543#comment-822 Hi Chris,

Thanks for the wonderful blog, very informative and helpful.
The rotateNV21toYUV420 you provided works great but the dimensions of the byte[] are kept intact, I mean byte[] obtained from onPreviewFrame() in portrait mode is 176*144 and after applying the method you provided the dimensions are still 176*144, could you please point to me what changes would be needed to make it 144*176 dimensions.

]]>
Comment on again with the marching by building a 3D surface plotter – words are toys http://www.wordsaretoys.com/2012/11/23/again-with-the-marching/#comment-331 Fri, 03 Apr 2015 11:13:08 +0000 http://www.wordsaretoys.com/?p=323#comment-331 […] been rendering surfaces for a few years now, and have even written a couple of demos around the topic. An arbitrary surface plotter was a natural evolution: enter an equation and see […]

]]>
Comment on roll that camera, zombie: rotation and conversion from YV12 to YUV 420 Planar by chris http://www.wordsaretoys.com/2013/10/25/roll-that-camera-zombie-rotation-and-coversion-from-yv12-to-yuv420planar/#comment-323 Thu, 19 Mar 2015 00:59:59 +0000 http://www.wordsaretoys.com/?p=543#comment-323 Hi Hieu,

The output format is IYUV, which is supposed to be compatible with I420. However, see http://www.fourcc.org/yuv.php#IYUV for a discussion of this topic…it isn’t clear if they really are the same. Wish I could tell you more.

Chris

]]>
Comment on roll that camera, zombie: rotation and conversion from YV12 to YUV 420 Planar by Hieu Phan http://www.wordsaretoys.com/2013/10/25/roll-that-camera-zombie-rotation-and-coversion-from-yv12-to-yuv420planar/#comment-309 Wed, 18 Mar 2015 08:28:20 +0000 http://www.wordsaretoys.com/?p=543#comment-309 Hi, is YUV420 in your post I420? I use output of rotateNV21toYUV420 as I420 but it is incorrect.

]]>
Comment on mapping the broken city by Michael Bourne http://www.wordsaretoys.com/2013/10/12/mapping-the-broken-city/#comment-65 Tue, 17 Feb 2015 11:17:20 +0000 http://www.wordsaretoys.com/?p=517#comment-65 Fantastic thanks for the quick reply,

It was actually very difficult to find even a good static top down image of a city that wasn’t hand drawn, fantasy orientated, too elaborate or just plain cartoony. i was delighted to come across this vast pro-gen city…

anyway keep up the good work, ill let you know how it turns out.

thanks for the info!

]]>
Comment on mapping the broken city by chris http://www.wordsaretoys.com/2013/10/12/mapping-the-broken-city/#comment-64 Tue, 17 Feb 2015 02:09:42 +0000 http://www.wordsaretoys.com/?p=517#comment-64 Hi Mike,

Thanks for the kind words! I hope this will be useful to you.

For the map markers, I would add to the onDraw function in map.js. After the chunks are drawn, you can iterate through a table of marker coordinates, and test each one to see if it occurs in the chunk area. (Look at the lines at the top of onDraw:


var cx0 = nearestChunk(viewport.x);
var cy0 = nearestChunk(viewport.y);
var cx1 = nearestChunk(viewport.x + viewport.width);
var cy1 = nearestChunk(viewport.y + viewport.height);

The rectangle (cx0, cy0, cx1, cy1) is the area the chunk represents. Any marker (mx, my) for which mx > cx0 and mx < cx1 and my > cy0 and my < cy1 is within that area, and you can draw it by translating the coordinates to the viewport and using one of the Canvas draw functions. See my example:
context.fillStyle = “blue”;

if (mx > cx0 && mx < cx1 && my > cy0 && my < cy1) { x = mx - viewport.x; y = my - viewport.y; context.fillRect(x, y, x + 5, y + 5); }

Google “HTML5 Canvas” for more ideas.

For the overlay, I think your idea of moving a large image will work fine. You can put the image into an img or div element, set the element to absolute positioning in CSS (look up position: absolute), and set the top and left properties in the onMove function. You will need to center the image at the center of the map–try something like


img.top = -(img.height / 2) + mouse.x;
img.left = -(img.width / 2) + mouse.y;

You will very likely need to play around with that to get it right, though. I hope that’s enough to get you started. Enjoy!

Chris

]]>
Comment on mapping the broken city by Michael Bourne http://www.wordsaretoys.com/2013/10/12/mapping-the-broken-city/#comment-63 Mon, 16 Feb 2015 19:31:31 +0000 http://www.wordsaretoys.com/?p=517#comment-63 hi Chris,
I stumbled on this rusty beauty whilst looking for procedurally generated sci-fi cities for use as a backdrop for a wargaming campaign (a sadly discontinued oldschool RPG called Necromunda). The feel of this map is absolutely perfect for the setting!

Anyhow i was tinkering with the source code and it gave me some ideas, well more questions than ideas really… i’m only an ambitious Newb when it comes to coding so if you could steer me in the right direction id appreciate it!

The ideal end-goal would be a very big city map with marked strategic locations and expanding territories (marked by colored zones) that would reflect the progress of a faction during a wargaming campaign (or lack of!).
its intended for a group of close friends to share and update (without hosting online). with that in mind the following questions arise:

-is it possible to add markers to the map at specific locations (preferably on a separate layer but synchronized to the movement of the map or is it tricky due to the discarding of chunks beyond chunksize*16 ?

-likewise how would i go about adding a colored opaque territory overlay, also synchronized with the scrolling of the broken city map.

i figure i could use the onmove if(mousedown) function along with a large picture (mostly transparent but containing territories and markers) with a higher z value than the broken city map. again im sadly unfamilliar with html or javascript but if you point me in the right direction i can figure out the rest!

Kind regards,

Mike

]]>
Comment on freebeard: algorithmic music for android by chris http://www.wordsaretoys.com/2013/11/15/freebeard-algorithmic-music-for-android/#comment-114 Fri, 06 Feb 2015 04:21:51 +0000 http://www.wordsaretoys.com/?p=563#comment-114 Thanks, JPS! That’s great to hear.

]]>
Comment on freebeard: algorithmic music for android by JPS http://www.wordsaretoys.com/2013/11/15/freebeard-algorithmic-music-for-android/#comment-113 Thu, 05 Feb 2015 19:56:43 +0000 http://www.wordsaretoys.com/?p=563#comment-113 The Freebeard app is certainly a fave of mine. The boredom problem has been prevented. I can play this app a long time like happy sonic wallpaper. Great when I want to get to some pleasant sound with minimum fuss. It seems endlessly varied and interesting.

]]>