3D Library Adventure

mdotedot

  • *
  • Posts: 1500
As you might have noticed I got sidetracked. The past days I didn't work on the Away3D Extension but
created a Particle Extension.

I'm stil trying to debug why it is working with some textures and sometimes with colors that doesn't appear to
be working on HTML5.

Result of investigation in the documentation:
Code: [Select]
All other targets should use Tilemap renderer.

html5 in canvas mode - fast, but doesn't support color effects.
native - fast and doesn't support color effects too (but this can be changed in future).


Since native doesn't support color effects as well I keep the HTML5 in canvas mode. The -D dom haxe compiler flag raised a lot of undefined types since it was looking for openfl._internal which stencyl doesn't include.



Play it yourself (from the 42 there are some particles not working and some 'only' work on white)
HTML5 Demo



Last week I've also worked on some LIBERADO conversion:



PS.: Edited result of color drawing analyses

« Last Edit: July 30, 2018, 11:10:14 pm by mdotedot »
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NerdinaNutshell

  • *
  • Posts: 109
I'm kind of confused, so is this running using Stencyl with an extension you made or...
Plot Twist... I'm a ghost

mdotedot

  • *
  • Posts: 1500
Hello NerdinaNutshell,

Thanks for the interest.

Using:
* Stencyl 3.5 Beta
* Stencyl/Haxe Extension based on  Away3D Library: https://github.com/openfl/away3d
* Most of the stuff work on all targets (Mobile, Desktop, Web)

It will not provide a true 3D engine since Stencyl doesn't provide tools and internal engine for this to work flawlessly.
It hopefully will be possible to make 2D games to look like 3D games.

There will be no documentation; only example games to investigate / copy paste from.

Maybe this clarifies things a bit!
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NerdinaNutshell

  • *
  • Posts: 109
I see, in other words would it be like pre rende graphics?
Plot Twist... I'm a ghost

mdotedot

  • *
  • Posts: 1500
There is no pre-rendering.  It is ' life '  3D. Please look at the examples that show both 2D and 3D versions. The 3D versions use blocks to convert/attach 3d objects to the 2D actors. I call it 'binding' .
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • *
  • Posts: 1500

Last couple of weeks I've published the Zame Particle Extension and worked on some Angry stuff:

Regular


FirstPerson Flight


Further time was spend on turning the Sokoban Game into a (local) multiplayer game which
could be controlled using XBox 360 and Playstation 4 controllers.

And most of that time was spend so that each player has its own undo list.






Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2234
Angry tests... awesome! I can see that first person perspective being a big hit with the right art... character expressions.

After GBJam I'll have to check out the Zame extension. I'm impressed you got it up and running that quickly.

mdotedot

  • *
  • Posts: 1500
Angry Hit? Well I'm not going to publish this game to a store.

If anybody has made a game in Stencyl and want to publish using this extension they can without permission. I took the angry bird example from Stencylforge so permission for this angry bird conversion needs to be obtained from the original creator of the stencyl forge stuff.

I personally feel that the best thing to publish is original stuff. Another angry birds wouldn't be as much fun (to make or play)

When someone wants to publish other examples that I make they need permission from LIBERADO.
I've had permission from LIBERADO to convert some of his examples to 3D . So he needs explicitly give permission to anybody to publish anything that I will provide based on his work.

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • *
  • Posts: 1500
Another LIBERADO example that I'm converting to 3D and making a game out of it instead of being a tech-demo.





I had a problem getting a calculation done. I'm trying to find a formula that uses the width of the actor
to determine its collision box. I can't find the formula so I used these stupid IF blocks:




If anybody knows the formula to calculate that offset I am grateful!

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2234
If anybody knows the formula to calculate that offset I am grateful!

I'm not sure what you're calculating. Is it relevant to the 2D -> 3D conversion?

I'm only visualizing the default collision bounds, but it doesn't sound like that's what you mean.

mdotedot

  • *
  • Posts: 1500
Thanks merrak for trying to help.

I found the issue. The LIBERADO example used actors with non-32px dimensions. AND there are different sized blocks introduced by M.E..  I forgot that my binding block only uses 32px based calculations.
So far I've not had any problems with this since most of the examples didn't require positional clicks.
And those that did were already 32px-based.

I've tried to alter the extension to work with different dimensions and was getting into bug upon bug.

So I decided to add a note to the block:


I know it is lame but there are other ways of creating and ' binding ' 3D assets with the extension. I just wanted some easy to use blocks that do a lot under the hood, but apparently there is more under the hood than I would like.

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2234
...but apparently there is more under the hood than I would like.

That's usually how it goes for me :D

I don't want to imagine the complexity of working out mapping (x,y) click coordinates to (x,y,z) world coordinates. Maybe your engine has a simple way to do that. Mine doesn't, and tracking all of the transformations that occur as a scene is constructed is a hassle.

Still, that's really neat to see binding can be done with a single block... even if it's bound to a 32px size.

mdotedot

  • *
  • Posts: 1500

My misunderstanding was that if the drawing was done with the same calculations that the resulting output would be the same.



When you look at the distance between the cubes they are matching the distance between the 3D objects (with a slight difference due to the 3D perspective)

So there is my misunderstanding. I thought if the difference between the 3D world and the 2D world didn't matter then the
collision didn't matter as well. All good except when you have different sized objects and you rely on collision and or
clickable objects.

Anyhow I made a special conveyorbelt demonstration with different sized Cubes to test the alignment with the really weird offset calculations:



The demonstration should help people who are trying to convert non-32px assets into 3D.



Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • *
  • Posts: 1500

Last week I was looking for other ways than importing objects from 3D Programs like Blender or tinkercad.
For now, the one that I like the most is https://www.tinkercad.com/
There are so many 3D tools and I am trying to find the one that delivers what I want from a tool like those.

Apart from importing OBJ, MD2(MD5) I was looking for ways I can combine shapes in Away3D code.
My estimation is that loading and parsing OBJ files seem slow and not so flexible. But I have to do some
experimentation with the things that I am trying to do.

This weeks work brought me to Extrusions and I am baffled how to make them solids.
These open shapes can be made by using PathExtrude:



But I really want to make them not transparent = solid.
And you would think that since I have the coordinates it would be easy to create a surface (top+bottom)

Well, I couldn't find any real solution. Most online searches brought me to  ' you have to triangulate your shape '
and ' use a  DelaunayMesh '. But all these assume you have your data based on triangle-points.

As you can see in the demo I want to make the shape from 2D points.

Sigh ... I might work on combining shapes into meshes and storing the data to load during runtime since this extrusion
way is not delevering m.e. what I'm looking for.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2234
Somewhere I had found an algorithm that takes a list of vertices forming a closed polygon and returns a list of triangles. I didn't bookmark it, but there are several out there. Does Away3D have something for that purpose built in?

Neither of the shapes you drew are closed, though. I noticed in GIMP when you use the free select tool it will detect when the mouse pointer is close to the starting edge of a polygon and round the coordinates to that exact point.