bitmap manipulation - add stretch and translate to zoom_rot

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

bitmap manipulation - add stretch and translate to zoom_rot

Post by jph_wacheski »

hi all,. I was random surfing and linked into this;

http://www.blackpawn.com/dev/tg.html

It is basicly a remake of the texture synth from werkzeug,. a very nice one,. that saves xml files!
got me trying to do more bitmap stuff in ZGE and with a few small additions it could be made much more usefull for creating sprites and textures,. Personally I find working with equations, while fun to experiment with, not that productive,. as it is often too difficult to quickly get what I am after,. so a few more simple manipulation components would sure help.

Adding a Stretch x and y amount as well as a Shift x and y to the ZoomRotate would be greatly useable,. I am also thinking of some way to add a blendMode component however with the tree structure I am not sure how we would route the inputs? but if that can be found,. having one with modes like these;

http://www.blackpawn.com/blog/?p=94

would roc! and if that routing issue can be figured, then some distortions would be possible as well,. .

a blur component could be added w/out too much trouble,.no routing problem anyway,. several modes would be very cool,. simple,gussian,radial,motion,etc.

as always, just stuff I would like to see to make ZGE even better.
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Thanks for the links, interesting stuff. Those photoshop equations will be useful if we add support for combining images. And additions to ZoomRotate should be easy to fix. I agree it is too difficult creating images from expressions alone and that ZGE should have better support for bitmap creating using more "operators" like Werkkzeug.

On Blackpawns blog there was a link to this stunning "Texas" 4k-demo:
http://pouet.net/prod.php?which=51448
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Dx10 only? :(

What we *might* do: "reverse engineering" on the XML file, so we get the way it is saved, then implementing back it on ZGE since it is just a sequence of operations, maybe using an advanced bitmap library like the ones I had already found and posted about, the ones at http://www.jansfreeware.com/jfdelphi.htm
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

yeah Fancisco I would like to have the latest hardware and OS too,. alas, not to be..,

found this video though; http://video.google.ca/videosearch?q=%2 ... emb=0&aq=f#

and wow! that was very interesting,. gives some insperations :D
Perhps you can use your mad mesh skills and get some of this to fly in ZGE ??

http://www.blackpawn.com/texts/pqtorus/default.html


Ville,. I hoped those blend mode equations could be helpfull ;) Hay I just noticed this one too, Blur codes!

http://www.blackpawn.com/texts/default.html

this guy is a wellspring of great info.s! peace all.
iterationGAMES.com
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Come-on guys,

These kind of things aren't that difficult ( middle-school level math ). I've attached a basic implementation of that Torus ( excluding offsetting the X / Y coords depending on the Radius angle ) to get you under way.

No idea why you'd ever want to use such a thing though ..

K
Attachments
Torus.jpg
Torus.jpg (34.17 KiB) Viewed 13530 times
Torus.zip
(610 Bytes) Downloaded 464 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

different understandings,. the problem of subjectivity!

Post by jph_wacheski »

Yeah, perhaps its not too difficult,. . for you Kjell! however, I hope you realise that you could be much smarter then many other mear mortals,. I notice this myself some times when I just expect others to have some basic understanding or developed skill that I just take for granted,. . Much like understanding the reasons for the failing of the monetary system and financial markets here in america,. but some times,. they just don't get it.

Anywho,. . thanks for the super nice implementation,. this is definently something I can WORK with. See, I just start by hacking away at the variables,. and the equations,. and then I 'find' interesting shapes and designs. However if I had to get the thing working, from some math I just don't quite grock, then that may never happen. So, really, thanks for the help bro!

I am very sure I can find many and interesting uses for such meshes. ;)

Attached is a little demo of what can be done with the Blackpawn's tg app., and ZGE of course!! just to inspire anyone to work on more texture generating components,. or relaseing some libraries of cool ploting functions!
Peace.

here is the xml for the bitmap;

Code: Select all

<texgen version="0.3">
    <state active="43"/>
    <node id="33" type="Save" x="160" y="96">
        <params name="one"/>
        <input id="47"/>
    </node>
    <node id="34" type="Add" x="160" y="112" width="272">
        <params mode="addClamp"/>
        <input id="33"/>
        <input id="36"/>
        <input id="38"/>
    </node>
    <node id="35" type="Load" x="272" y="80">
        <params name="one"/>
    </node>
    <node id="36" type="RotoZoom" x="272" y="96">
        <params rotate="80" zoom="64" cx="128" cy="128"/>
        <input id="35"/>
    </node>
    <node id="37" type="Load" x="336" y="80">
        <params name="one"/>
    </node>
    <node id="38" type="RotoZoom" x="336" y="96">
        <params rotate="123" zoom="66" cx="128" cy="128"/>
        <input id="37"/>
    </node>
    <node id="39" type="Color" x="336" y="240">
        <params color0="0x00000000" color1="0xff59ff27"/>
    </node>
    <node id="40" type="Blur" x="384" y="160">
        <params amplify="46" radius="0" passes="3" type="xy"/>
        <input id="42"/>
    </node>
    <node id="41" type="Bchsl" x="320" y="144">
        <params brightness="-0.14" contrast="2.86" hue="0.29" saturation="1" lightness="0.5"/>
        <input id="43"/>
    </node>
    <node id="42" type="Glow" x="384" y="144">
        <params color="0xffffffff" posX="128" posY="128" sizeX="128" sizeY="128" gamma="16"/>
    </node>
    <node id="43" type="RotoZoom" x="320" y="128">
        <params rotate="132" zoom="75" cx="128" cy="128"/>
        <input id="34"/>
    </node>
    <node id="44" type="RotoZoom" x="64" y="48">
        <params rotate="85" zoom="64" cx="128" cy="128"/>
        <input id="45"/>
    </node>
    <node id="45" type="Glow" x="64" y="32">
        <params color="0xffffffff" posX="134" posY="131" sizeX="130" sizeY="5" gamma="16"/>
    </node>
    <node id="46" type="Noise" x="192" y="64">
        <params color="0xffffffff" octaves="7" scale="1" seed="11"/>
    </node>
    <node id="47" type="Distort" x="160" y="80">
        <params amount="41"/>
        <input id="48"/>
        <input id="46"/>
    </node>
    <node id="48" type="Add" x="0" y="64" width="176">
        <params mode="addClamp"/>
        <input id="51"/>
        <input id="44"/>
        <input id="50"/>
    </node>
    <node id="49" type="Glow" x="0" y="32">
        <params color="0xffffffff" posX="128" posY="128" sizeX="145" sizeY="5" gamma="16"/>
    </node>
    <node id="50" type="RotoZoom" x="128" y="48">
        <params rotate="17" zoom="55" cx="131" cy="106"/>
        <input id="52"/>
    </node>
    <node id="51" type="RotoZoom" x="0" y="48">
        <params rotate="0" zoom="64" cx="128" cy="128"/>
        <input id="49"/>
    </node>
    <node id="52" type="Glow" x="128" y="32">
        <params color="0xffffffff" posX="132" posY="111" sizeX="112" sizeY="4" gamma="14"/>
    </node>
</texgen>
Attachments
the bitmap created in tg,..
the bitmap created in tg,..
lectro_flash.jpg (6.75 KiB) Viewed 13504 times
voiceOfPlasma_005.zip
small sparks demo,.
(54.89 KiB) Downloaded 543 times
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I've emailed the TG-guy and asked for help. Let's hope he is willing to share some texture-secrets with us ;)
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Yep! We just need the authorization to: distribute his executables and examples, and, we do just need to understand how the "normal" component works!!! I just did not figured it :D
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

I am not asking anyone to do that,.

Post by jph_wacheski »

Why are you saying "distribute his executables and examples"? I am not asking anyone to do that,. just to implement some similar texture sysnthesis componenets in ZGE. These are not unique to this program,. the tg app. is actually a very clear remake of werkzeug,. I just find it a nice example of some of the methods we could add to ZGE,. . and Blackpawn has posted much code samples and explinations of some of this stuff,. obviously he is interested in sharing some knowlage. I also tryed to email him but got a Delivery failed. :(

the xml I posted is just so you can see my spark in the tg editor,. and hopefully figure a way to do some similar thing in ZGE!

peace.
iterationGAMES.com
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

i meant: Creating a parser is somewhat "faster" then creating the interface from scratch! So if we were able to distribute his .exe, we could use the program for generating the .xml tree (texture file) then importing it inside ZGE and forget about all the troubles creating a new interface can bring!
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I was thinking along the lines of implementing some of the features from TG in ZGE, and still somehow make ZGE existing interface work. I think it could be possible. Yes his tg-mail do not work so I emailed another address that I found on his site and it hasn't bounced back yet.
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

The first thing that came in my mind is a new component "Load Bitmap" that just pushes on the stack another bitmap created with ZGE, so it can be used from other components like expressions! I think it is really needed :D BUT we must avoid any editor crashing when someone creates a loop! Then just keep thinking on various components like blur or stuff like that.
I might start thinking about the parser, maybe even another external program that reads the .xml of the texture from tg and then outputs ZGE-xmlwith the components at the right place. Then we just need to read it from a temporary txt file or past it directly from the clipboard. I will start studying Python at University now and the exams will be about trees and other data structures :D

I honestly think that this is the only short-way out.
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

kattle87 wrote:The first thing that came in my mind is a new component "Load Bitmap" that just pushes on the stack another bitmap created with ZGE, so it can be used from other components like expressions!
My thoughts exactly :)

Something like this:

Example list of Producers for a bitmap:
- BitmapExpression (stack holds one bitmap)
- BitmapLoad MyOtherBitmap (stack now holds two bitmaps)
- BitmapCombine (requires two bitmaps, pop two from stack and combine. push result)
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

humm,. yeah that sounds interesting.

here is a super bright little texture I just create playing with the ideas,.

if i only had a blur, and a cell,. and a distort,. and a,. .
yeah whatever you guys can come up will I will put it to use!
Attachments
bitmapStacking3.zgeproj
the source,.
(1.18 KiB) Downloaded 502 times
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I haven't received any answer from the guy yet, but I was experimenting with using loops inside producers to achieve some cool feedback effects.

Copy the text and paste it inside ZGE to view the bitmaps:

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Bitmap Width="3" Height="3">
  <Producers>
    <Repeat Count="64">
      <OnIteration>
        <BitmapRect Color="0 0.502 0.502 1" Size="0.1 0.1 0.15 0.15"/>
        <BitmapZoomRotate Zoom="0.1" Rotation="0.038"/>
      </OnIteration>
    </Repeat>
  </Producers>
</Bitmap>

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Bitmap Width="3" Height="3">
  <Producers>
    <Repeat>
      <OnIteration>
        <BitmapRect Name="Rect1" Color="0.5291 0.5291 0.5291 1" Size="0.2674 0.2012 0.4674 0.4012"/>
        <BitmapZoomRotate Zoom="0.001" Rotation="0.001"/>
      </OnIteration>
      <WhileExp>
<![CDATA[float temp1,temp2;

Temp1=rnd() * (2*3.14);  //Random angle
Temp2=rnd() * 0.85;    //Random radius
Rect1.Size.X=sin(Temp1)*Temp2 - 0.1;
Rect1.Size.Y=cos(Temp1)*Temp2 - 0.1;
Rect1.Size.Z=Rect1.Size.X + 0.2;
Rect1.Size.W=Rect1.Size.Y + 0.2;

//Random color
Temp1=rnd();
Rect1.Color.R=Temp1;
Rect1.Color.G=Temp1;
Rect1.Color.B=Temp1;

return this.Iteration<128;]]>
      </WhileExp>
    </Repeat>
  </Producers>
</Bitmap>
Just simple examples but I'm sure it has potential to make pretty textures.
Post Reply