Page 4 of 7

Re: OMEGANAUT

Posted: Thu Jul 19, 2018 10:06 am
by Ats
Haha, thanks for the Corneria background :)
So in order to fit the background to the viewport and cover some camera movements, I only have to make a bigger CorneriaMesh?

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" ScreenMode="0" CameraPosition="-1.8277 -0.8122 10" RenderOrder="1" FileVersion="2">
  <OnLoaded>
    <ZExpression>
      <Expression>
<![CDATA[//

for(int i=0; i<4; i++)
{
  Box.Position.X = random(0, 4);
  Box.Position.Y = random(0, 4);
  Box.Position.Z = random(-10, 8);

  Box.Rotation.X = rnd();
  Box.Rotation.Y = rnd();

  Box.RotationVelocity.X = random(0, 0.125);
  Box.RotationVelocity.Y = random(0, 0.125);

  createModel(Box);
}]]>
      </Expression>
    </ZExpression>
    <Variable Name="GameTime"/>
  </OnLoaded>
  <OnUpdate>
    <ZExpression>
      <Expression>
<![CDATA[GameTime += App.DeltaTime;
App.CameraPosition.X = cos(GameTime/2)*2;
App.CameraPosition.Y = sin(GameTime/2)*2;]]>
      </Expression>
    </ZExpression>
  </OnUpdate>
  <OnRender>
    <UseMaterial Material="CorneriaMaterial"/>
    <RenderMesh Mesh="CorneriaMesh"/>
  </OnRender>
  <Content>
    <Mesh Name="CorneriaMesh">
      <Producers>
        <MeshBox Scale="20 10 1" Grid2DOnly="255"/>
      </Producers>
    </Mesh>
    <Bitmap Name="CorneriaBitmap" Width="512" Height="512" Filter="1">
      <Producers>
        <BitmapFromFile DataWidth="512" DataHeight="512">
          <BitmapFile>
<![CDATA[78DAEDDD2B731B491706E0BFB170E107030303030D03050307060A060A1A0A061A060606FA277DB3EE55EFD1E99ED1C8D62DF2A37ACAA5CB68A6FB3DAA6AF55CE4BFBE7CFC0B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E014FE5E7D020000000000000000000000000000000000000000CEE47F5F3F03000000000000000000000000000000000017F661780000000000000000000000000000006EC4C76F5F0000000000000000000000000000801BF169BD0200000000000000000000006EDCE7EF5F0100000000000000803FD4C366000000000000EECC97C76F00000000DCB1D5E37700DEA1AF8F8F00BC43C3760BC03BF4EDC70F00DEA1F5D31300EF9019100000000000000000000000000000DCB7F5F6E98EDBFCEADE5D2C16F9CB5FFEF27FCB1BC785E3F2ED7BA7D6D65D72C9A6CB6207DF7E6CF7A75618573BD5C257F76561D7E42F7FF9CBFFA6F28FCD3BAA616943F199A336DA6D467972FBF4EBD8B1B2DBD4713DA3D4E6B61CE9BDE58DC77E98EBBB8E2D96FCE52F7FF95F3EFFB89599F1AB9B5EEDDAC122CE57A1B63936BEDBFD6E56EDE724AD39869F1A3CD585EE924BBA237FF9CB5FFEB79F7FBBF5F6BD532D2C4F3EBFDCEAABB1B3CBF3FFF9FBB9ACADBCBDAEA43CDF4DA61DB8DB11B6AE705C4F1B75DDE2F86A6A407C75AA58DDBEA4B7C85FFEF297FF6DE6DF5DBEDB8B944359AC865F4B90D26BB7183B959E8F09C4DC8A34B74AE14FA5D4CD36BDD4155FEDE639F3294D733DF9CB5FFEF2BF9DFC6BF7DBF1A876392550E28D393FF76EDD012BD531F528C6D596A06EA80CA0F193D0D634F6A8A617DB167B515EAACBC425EB02A97631A8FA52B78F69BAD7D64EFEF297BFFCAF927FDCAFD50E8871B02B6B2BB7F23045DD861F07E26EC26DBFBAD589CFC7FCE3305A57D5DD4A6C7CAA450AF9E0701CFB38F59DA4FD2630755049FEF297BFFCAF98FFD4E4AB96A676AADC29F9B7258B694CCDC5DAB1B55B82EE6A8BFA01688FCECF6495EE4F7D6788F9778B355582EEF1A9B40333BD94DE257FF9CB5FFE97CC7F26C66E1FE3F27186D54637351D8B6368BB9BAB3DEC923A5877F7D5EF006973719218B3EA0EB8074BD0AD66BCDF9E121077B8B58DEF9E9F267FF9CB5FFE97CFBF3D523C35692A4BC6DD6533D3AE6EFE71F4ECEEDA4ABBE3DAE94C9AB0742768DDB95577FE35559176BF5F77F9B6C1ED7CB6FDAAD3F648FEF297BFFCAF927F77FC4D73B158A3B4936AA1B4A1A95E77D73CF38149C59A0AAA5B82F92A84C6F4A772ED189D4E5A2BCF2CBC5C45FEF297BFFCAF927F3B7F99996ACD8F53F3D1CDE7DFAE3095238ED1ED2CB27B9CA57B6C254ECDEABBE6BF12B423EFFCCEC3DACDEE54B78D57FEF297BFFCAF927F3C19A93B292B1B7DD8FE2C0ECE56BA5578B9FF3C558234FF8AB3B9144277BC6BCF955DBE63AD8EB0690A39B3E72DADA77BBE59FD54CC5C8A2E7FF9CB5FFED7CD3FED768B752923480CBF6AC7E2D2AAF252B913179E394013334FF977939C3A39EAE07196927637BAB4FEA951B8FD863075CAF1D485EAED1DF9CB5FFEF2BF4AFE29FCF16F79B53E6C936FC5A6CE2CD62D413B0F9A39396A7EAFDD7CF229BAE547E4BB7B05DBF2A56EB633C4A98FBDFCE52F7FF95F31FFEE75134B927F857682D6EECE4AAD9AB9C46F4909627D0FAE6AC981A114FE541FBBC9B7179ECB5FFEF297FFB5F26FB778A6E427CA51FBF51CEEF74FEE3D78D2EC7C86F3D3AE8557E42D4F29FEA848DC23973A287FF9CB5FFE57C9FF2A99CF94607FB07BDE4DD69EA79A3D1F60F76CAB999CE747DEBAC051BD9B39F1201ECC92BFFCE52FFF0BE77F536237DB335AD3B83C7341449BEAD4F1FDEEEEBE7482569AD6BDAE5FB719B8FCE52F7FF9DF5E15F6AE6E0EBFF5B7F7647B3D457B647FEAE8F9D4295B533FC1F40705287FF9CB5FFE775085987C947E5E2FE53675A144EFF4E0E738EF8B4BB60774DE4FF8F297BFFCE57F1B85E85FEC36FF3BAEDD874B2E157FCF63AEFCE52F7FF9DFF2DEB94379FE7B103F1CC1790EFF33A2FF2F75D2C3773EE0CA5FFEF297FF8D4FCDE205D4E9DAB73053ABF3A9FEEFEFA5D9595940C2F2973FF2BFFD79D92EDB94FFAF99B3ADA64EE89DBF7810F9CB1FF9DFDA581C47E17048E5C0395AD296BFFC91FF7DEC978B13B178BC3EFCA39C7F884BFEF247FE777CD66EFA25BDF46380C85FFEC8FF2E77CAC59D6C0291BFFC913F00B4563B0FBBBFB7D32AF9CB5FFEF297FF05C2BF6EAF57AF2DC4AA31B3C0095BBBDDFDDD2EDBC4AAF750FEF297BFFCAF927FF75D672AC1FAC569C7E2D562C38BF988D6C734A6AC70BB33CC6E227DC359CD7E66E42F7FF9CBFF62F9D7F77647E793C4BEDE0D526D15D6AFAAC2541756FB21D497D6419BC67A5FDC684CA6DDDCB05F88755385D5FE2656F297BFFCE57F1BF90FB39B7E785B0962F2A31F3F7E3E3DFD1C6FE39DF92D1E2BF6A2C635ECBFB40963E53A4434EC1EAEC3AB69E5ABF077086F89CAFA37FBCD889F8A58FD617F55F297BFFCE57FF9FC4BC336FB2568C7E237265F6F63F267DD83B769CA1AC31FB75EFFAE9B4FE010DABC5E30E076C7DF4DB06ED61CE35D87B6C95FFEF297FFE5F3DF4CEB5661F5AAA3E40787F873ECE84B1B1AC31947FFD198FF68D3CB2A8D89EDF42D85B3C4A6E9FE7CECF297BFFCE57F99FCB7D3860525581D9349F710CCEA3C877B36FBDB2AE1975BA9422D441C37D7DB7F9FAC351A263EB4359F71B12525D884950C0BC297BFFCE52FFF0BE45FDBB00D5B4F2588B53836ABF680C8C2BD7CAB5394A0E63FDE7EBDDCDA1294FE6E5EBA5F6B544BD01D2EEB02E536F4A657537B3887FD55C95FFEF297FF55F28FC34D11DB5697D934C3F16A41ECE9C4A7B63D5353B9538DC8E5404FC9FFBF9FE00BA3F0EFDFBF53F76BF89B5EEC35A272AB052D2518F6DFB2D97F66B3BF4FB21BBEFCE52F7FF95F2CFF1A75FD1BA5B6A55178EA84D2F694A4EEFEBDCBEC8E1B6FB504BF77B7925B7D1873881FC21A784CBE84DFAEA1E4B3D98DE349BBAAB842F9CB5FFEF2BF7CFE75302AEBA9234B9CA4A4720CD3836C7B5AD7CC8EBE34F7D99CAD1CEB30231BFB380EC1B110A9B3E3332584D8F1748BC9C7FCCB701FBBD69DEBC5CFB9FCE52F7FF95F37FFBAC27AFF57B8C54D97F5B4A7BFA6939D36BDF95D778C4B874286539CFD35B347AE28258885A843EAF864DBEB987C37FCF644AC54DF54D0B245F9CB5FFEF2BF62FE7585ED6AD36CA5B6EA601FDBFD4B35E178F8A32D6B797E387315DA42D46ED67D74B104298452B8D29DF632BD7A503E06DB7E9853D1E52F7FF9CBFFF2F9C7ADD7FBE9BF18C45A2CE95DBBB7AA5C79515A558E80C4EEA40322651A580B51133B7915865D096A37CB9D322CCE845007DC87ED5C094A7FDB4F724D3BBE2A7FF9CB5FFE17CE3FADFC9FFF5CB07FD15C6DC092DFC4D8EC824A07A9EBFA5397DBAEA58323E39D7A5C7B385B096A93EAD78094DBF8649DAF956177EAEBC110EEA4E9673BE96B1390BFFCE52FFF8BE55F16FEEF1F96ED9F295AAAB0FC6791D2A1E7F1993A61297396218C7AF5F978A77B4BD7329CBC04F12CA9927F6D4C3C952BCEB986FDB41F66C7E23822A7E335F297BFFCE57FDDFCDFDE85998B26E2456A0FBD6BD3C6CED6EE97E9587DA6DC7938CFEEB8A1578234F81EECEFB15B69CF6493BFFCE52FFF3F37FF874317E875C34F1D8FF7BB83FE30FDB3A86F6F76D9749CFACD4C394FB2B9E13C6B96BFFCE52FFF53E5BF3ACF303DCC0E67C3FEB03593F970EA64EA3191331DF1198E6CB9FCE52F7FF95F2BFF63837DCBBBCED4BCE5DF1CE28EB80B6C57FEF297BFFCFFF4FCEF8958E42F7FE40F000000C01DF8FC080000BC179F360000C07BF1F13B0000F05E7C5803000000000077E7DB130000000000706F861F0000000000000000000000C0ADFBBA0500000000000000000000006EDDEA11000000000000000000000000000000000000000000000078AB2F1B0000000000000000000000000000000000000000000000E0AD1EBE0300000000000000000000000000000000000000000000000000000000000000000000C0FDFBBC060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080EBFBF40D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EFB38000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070091FBE02000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009CC4FF0134C57BC5]]>
          </BitmapFile>
        </BitmapFromFile>
      </Producers>
    </Bitmap>
    <Material Name="CorneriaMaterial" Shading="1" Light="0" ZBuffer="0">
      <Textures>
        <MaterialTexture Texture="CorneriaBitmap" TextureWrapMode="2" TexCoords="1"/>
      </Textures>
    </Material>
    <Model Name="Box" Position="3.7319 -2.9679 -7.7437" Rotation="0.3905 0.7984 0" RotationVelocity="0.114 0.041 0">
      <OnRender>
        <UseMaterial Material="BoxMaterial"/>
        <RenderMesh Mesh="BoxMesh"/>
      </OnRender>
    </Model>
    <Mesh Name="BoxMesh">
      <Producers>
        <MeshBox/>
      </Producers>
    </Mesh>
    <Material Name="BoxMaterial" Shading="1"/>
  </Content>
</ZApplication>

Re: OMEGANAUT

Posted: Thu Jul 19, 2018 10:20 am
by Kjell
Hi Ats,
Ats wrote:So in order to fit the background to the viewport and cover some camera movements, I only have to make a bigger CorneriaMesh?
Depends on what you want. Normally making it bigger or moving it closer to the camera ( same result ) will suffice .. but if you want to do a 2D background in the style of Star Fox ( or like Virtua Fighter ) you probably don't want to rotate the camera. Instead the background rotation is "simulated" using horizontal & vertical column scrolling ( creating a skewing effect ).

K

Re: OMEGANAUT

Posted: Sun Jul 22, 2018 7:43 pm
by Ats
The background is fixed because it's happening in space. But I'll use your Virtua Fighter example when I'll work on planets :)

Image

Here's the new version of OMEGANAUT, with a randomly generated background and another enemy ship:
http://www.txori.com/index.php?static21/omeganaut

I'll try to compile ZGameEditor with the latest FPC in order to see if things work on Android API >=23

Re: OMEGANAUT

Posted: Wed Jul 25, 2018 10:02 am
by Ats
"That's no moon!" - Ben

Image

This morning, I had the time to add planets to Omeganaut. I'm amazed at how quickly this game is taking shape :D

Play Omeganaut (PC, Android is still crap...):
http://www.txori.com/index.php?static21/omeganaut

Is it possible for the second layer of background to appear by using transparency? For the purpose of adding an atmosphere to the planets.
If not, I'll find something else using the Y position.

Re: OMEGANAUT

Posted: Mon Aug 20, 2018 9:27 am
by Ats
Hi, I've been stuck on this for a while now... Back when I started making that game, I made the ship turning left and right without rotating it on his Y axis. Everything was working fine, but the controls looked a bit like Tempest instead of Star Fox: you could only shoot straight ahead.
But now I have changed the controls so that the player can shoot at the edge of the screen while turning. And now, surprise, the "barrel roll" rotation on the Z axis is completely broken...

I've made a simple example so you could understand the problem:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" CameraPosition="0 2 20" FileVersion="2">
  <OnLoaded>
    <SpawnModel Model="PlaneModel"/>
    <ZExpression>
      <Expression>
<![CDATA[App.CameraPosition.X = 0;
App.CameraPosition.Y = 2;
App.CameraPosition.Z = 20;]]>
      </Expression>
    </ZExpression>
  </OnLoaded>
  <Content>
    <Mesh Name="PlaneMesh">
      <Producers>
        <MeshBox Scale="0.4 0.4 5"/>
        <MeshBox Scale="3 0.2 1"/>
        <MeshTransform Position="0 0 3.8"/>
        <MeshCombine/>
      </Producers>
    </Mesh>
    <Model Name="PlaneModel">
      <Definitions>
        <Variable Name="Roll"/>
        <Array Name="Axis" SizeDim1="2"/>
      </Definitions>
      <OnUpdate>
        <KeyPress Comment="space" Keys=" " CharCode="88">
          <OnPressed>
            <ZExpression Expression="Roll = 1;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="left" Keys="<" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[0]--;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="right" Keys=">" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[0]++;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="up" Keys="^" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[1]--;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="down" Keys="_" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[1]++;"/>
          </OnPressed>
        </KeyPress>
        <ZExpression>
          <Expression>
<![CDATA[Roll -= Roll * 6 * App.DeltaTime;
if (Roll > -0.001 && Roll < 0.001) Roll = 0;

axis[0] = clamp(axis[0], -10, 10);
axis[1] = clamp(axis[1], -10, 10);

CurrentModel.Rotation.X = axis[1] * 0.01;
CurrentModel.Rotation.Y = axis[0] * 0.01;
CurrentModel.Rotation.Z = Roll;]]>
          </Expression>
        </ZExpression>
      </OnUpdate>
      <OnRender>
        <RenderMesh Mesh="PlaneMesh"/>
      </OnRender>
    </Model>
  </Content>
</ZApplication>
First press spacebar. The ship is rotating on the Z axis correctly, same as before. Now press the the arrow keys to turn the ship a bit and press spacebar again. It looks as if the Z axis of the model didn't turn with the model, while the rotation on X and Y are working correctly.

You can see that directly in the editor while playing with the model's Rotation option. I don't know how to handle that...

EDIT:
Nevermind, I've just managed to make it work by using a RanderTransform for the Z axis :oops:

Re: OMEGANAUT

Posted: Mon Aug 20, 2018 9:43 am
by Kjell
Hi Ats,

This is because the euler-angles order is "incorrect" / unsuitable for your use-case. Unfortunately you can't change this order in ZGE .. but fortunately you can circumvent this problem easily by adding a RenderTransform :) Here's a modified version of your snippet ..

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" CameraPosition="0 2 20" FileVersion="2">
  <OnLoaded>
    <SpawnModel Model="PlaneModel"/>
    <ZExpression>
      <Expression>
<![CDATA[App.CameraPosition.X = 0;
App.CameraPosition.Y = 2;
App.CameraPosition.Z = 20;]]>
      </Expression>
    </ZExpression>
  </OnLoaded>
  <Content>
    <Mesh Name="PlaneMesh">
      <Producers>
        <MeshBox Scale="0.4 0.4 5"/>
        <MeshBox Scale="3 0.2 1"/>
        <MeshTransform Position="0 0 3.8"/>
        <MeshCombine/>
      </Producers>
    </Mesh>
    <Model Name="PlaneModel">
      <Definitions>
        <Variable Name="Roll"/>
        <Array Name="Axis" SizeDim1="2"/>
      </Definitions>
      <OnUpdate>
        <KeyPress Comment="space" Keys=" " CharCode="88">
          <OnPressed>
            <ZExpression Expression="Roll = 1;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="left" Keys="<" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[0]--;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="right" Keys=">" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[0]++;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="up" Keys="^" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[1]--;"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="down" Keys="_" CharCode="88">
          <OnPressed>
            <ZExpression Expression="axis[1]++;"/>
          </OnPressed>
        </KeyPress>
        <ZExpression>
          <Expression>
<![CDATA[Roll -= Roll * 6 * App.DeltaTime;
if (Roll > -0.001 && Roll < 0.001) Roll = 0;

axis[0] = clamp(axis[0], -10, 10);
axis[1] = clamp(axis[1], -10, 10);

CurrentModel.Rotation.X = axis[1] * 0.01;
CurrentModel.Rotation.Y = axis[0] * 0.01;
PlaneRoll.Rotate.Z = Roll;]]>
          </Expression>
        </ZExpression>
      </OnUpdate>
      <OnRender>
        <RenderTransformGroup Name="PlaneRoll">
          <Children>
            <RenderMesh Mesh="PlaneMesh"/>
          </Children>
        </RenderTransformGroup>
      </OnRender>
    </Model>
  </Content>
</ZApplication>
K

Re: OMEGANAUT

Posted: Mon Aug 20, 2018 9:47 am
by Ats
Thanks Kjell, I just came up with the exact same solution while you were typing your answer. Sorry :oops:
Writing my problem to the forum must have clarify a few things in my mind :)

Re: OMEGANAUT

Posted: Tue Nov 20, 2018 11:35 am
by Ats
I've just uploaded a new version of Omeganaut with better controls and colourful atmospheres for the planets:

Image

Sadly, I wasn't able to do a colour pickup on the background before drawing the ships, so the fog colour can be a bit shifted when in space.

Now, to the mountains and other obstacles!

Re: OMEGANAUT

Posted: Tue Nov 20, 2018 12:51 pm
by Kjell
Hi Ats,
Ats wrote: Tue Nov 20, 2018 11:35 amSadly, I wasn't able to do a color pickup on the background before drawing the ships, so the fog color can be a bit shifted when in space.
This doesn't seem like a situation where you should be using glReadPixels to determine the fog color .. but perhaps you're trying to do something very creative / exotic?

K

Re: OMEGANAUT

Posted: Wed Nov 21, 2018 8:00 am
by Ats
I'm creating the space background by adding 3 random cloud bitmaps, so I was using the glReadPixels in order to retrieve the colour in the middle of the screen, where most of the enemy appear, and set the fog colour to that. I guess I could read the colour in the middle of the 3 clouds while creating them and store them in order to know the colour afterwards.

Something like:

Code: Select all

CloudColor1:Variable<vec3>
CloudColor2:Variable<vec3>
CloudColor3:Variable<vec3>

CloudBitmap1:Bitmap
BitmapExpression
if (X==.5 && Y==.5) {
CloudColor1.X = Pixel.R;
CloudColor2.X = Pixel.G;
CloudColor3.X = Pixel.B;
}

and so on for CloudBitmap2 and CloudBitmap3.
And then set the fog color by making some kind of average:

fogColor.R = (CloudColor1.X + CloudColor2.X + CloudColor3.X) /3;
fogColor.G = (CloudColor1.Y + CloudColor2.Y + CloudColor3.Y) /3;
fogColor.B = (CloudColor1.Z + CloudColor2.Z + CloudColor3.Z) /3;
That should work.

Re: OMEGANAUT

Posted: Fri Nov 30, 2018 6:24 pm
by Ats
Even though the Android version of the game is doomed with Google Play new API restrictions, I've added a virtual gamepad, and it's quite enjoyable :D

Image

So now I'm playing with randomly generated rocks and mountains, and so I have a question concerning the collision boxes... :roll:

Image

You'll see you can go through the base of the mountain, or get hit while passing through thin air on the top of the model...
Can I use something like ZGEBox2D to handle that or is there another simpler solution?

Re: OMEGANAUT

Posted: Sat Dec 01, 2018 12:38 pm
by Kjell
Hi Ats,
Ats wrote: Fri Nov 30, 2018 6:24 pmCan I use something like ZGEBox2D to handle that or is there another simpler solution?
ZGE unfortunately still doesn't have mesh-collision built-in .. so you either need to use a library or use your own collision detection routines. A additional problem is that in order to use a library or your own routines, is that you need access to the mesh data, which isn't ( easily ) possible when you're using the Mesh component, so can't use that either anymore.

Anyway, just to show you that it is possible .. attached is a rudimentary demo that uses two ray-intersection tests along the wing edges of the plane you control.

- When there's no collision with a rock, the rock is green.
- When there's collision with the bounding volume of a rock but no actual collision, the rock is yellow.
- When there's collision between the line-segments along the wings of the plane and a rock, the rock is red.

This also means that when the plane is fully inside a rock, there's no actual collision ( so the rock will be yellow ).

K

Re: OMEGANAUT

Posted: Mon Dec 03, 2018 7:35 am
by Ats
Hi Kjell

Thanks for this great exemple. I've played a bit with it and it's quite understandable. But I can't aford to create models using code only. I need to see what I'm doing on the fly. So right now I'm making some tests with ZGEBox2D. If I can manage to collide flying spaceships with fixed mountains without everything going crazy under zero gravity, it will be a win for me. Plus, it will be interesting to see explosion debris bouncing here and there :D

Re: OMEGANAUT

Posted: Mon Dec 03, 2018 10:34 am
by Kjell
Hi Ats,
Ats wrote: Mon Dec 03, 2018 7:35 amSo right now I'm making some tests with ZGEBox2D.
If you're going to take the external library route i'd recommend Bullet over Box2D for 3D games.

K

Re: OMEGANAUT

Posted: Fri Jan 11, 2019 4:17 pm
by Ats
With the new android settings for API26+, I finally managed to push Omeganaut back to the Play Store (VilleK, can you add this new Android template to ZGameEditor?)

Omeganaut Android: https://play.google.com/store/apps/deta ... .omeganaut

Image

Now I have a weird bug on devices that runs under GPU Qualcomm Adreno (Xperia, Huawei...). The faces are inside out and the z-order is inverted... I've started to make some tests but nothing conclusive right now. But I managed to find a friend with such a phone nearby, so I'll be able to dig that next week.

Image