3D Library Adventure

mdotedot

  • *
  • Posts: 1479
The ' closed ' shape is done using a boolean where the extrude will make a connection from the last point to the first point.

There are some formulas I found for creating a list of triangles, but the ordering and non-concave shapes worry me.

All communications so far on this topic on Away3D is telling how to add mesh (mergeMesh) to the existing extrusion but they all rely on vertexes points made by triangle points. Some formula calculated the middle of the shape to let all triangles go to, but again that will not work with shapes that have holes or make indentations.

I could easily make the ' close'  function in the create function but let the Away3D extrusion call do it :D

The reason I was using a 3D library like Away3D is that I lack the 3D calculations to make an engine myself. There is too much work to be done so I was hoping that a library could help me ' cut corners ' .  I guess not everything that I hoped for was provided. Or at least I haven't found it yet.
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: 1479

As usual I can't really stand that I couldn't workaround the issue.

There is a way to triangulate a 2D shape / face :
https://github.com/vujadin/EarcutHx

Using this I can create (Sub)Geometry and create a Mesh from it.

Unfortunately so far it only works for Flash :(



                  
                  
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.

NickamonPoppytail

  • *
  • Posts: 1022


This is looking really good! It’s a shame this only works on Flash, though.
046 121 116 105 116 110 101 100 105 032 121 109 032 116 117 111 098 097 032 110 111 105 116 115 101 117 113 032 111 110 032 101 118 097 104 032 100 108 117 111 104 115 032 117 111 089 032 046 084 074 032 101 114 097 032 115 108 097 105 116 105 110 105 032 121 077 032 046 117 111 121 032 107 099 097 116 116 097 032 108 108 105 116 115 032 108 108 105 119 032 073 032 100 110 065 032 046 116 114 105 104 115 032 115 105 104 116 032 103 110 105 114 097 101 119 032 108 108 105 116 115 032 109 097 032 073 032 046 110 111 115 032 115 105 104 032 109 097 032 073 032 046 101 109 032 119 111 110 107 032 121 097 109 032 117 111 089

mdotedot

  • *
  • Posts: 1479
Thanks for the interest.

I found that on HTML5 it draws smaller and off screen  . So maybe it needs extra calculations.
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: 1479

The extrusion is driving m.e. nuts (but that doesn't take much :D )

First the good news :
* Tested the one face drawing on HTML5, Flash, Windows and that works
* So Extrusion and 'single' face work

But I wanted to use the face to combine the extruded form with the single face.

After hours and hours of investigations and trial and error on positioning stuff I finally manage to get
a standard shape (0,0 250,0 , 250,250, 0,250, 0,0) working:


But the same calculations fails misserably with a free form  :(



I was planning on doing other things with my time but well ...

So hopefully I find the ' stupid calculation ' mistake to fix this with less time than it took me so far. We will see.

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: 1479
The couple of days I needed a break from the Extrusion Calculations.
I started work on an editor.
The reason I want this is that I want a low-cost object creator. You can use Blender and other tools to create
OBJ files and load them with the Extension.
But my estimation is that the loading/parsing of the OBJ file takes more resources than creating objects ' on the fly '.

I might use the editor later for the Free Form shape anyway so that I can rotate the meshes 'easier'.



« Last Edit: September 14, 2018, 12:38:56 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.

mdotedot

  • *
  • Posts: 1479
Editor should be ready.

Click for editor:
Draw3D

Now I need to port the Extension Blocks to a single load block so that the saved file can be loaded.
I might even use option to load it from the extras folder instead of the online location.

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.

squeeb

  • Posts: 1417
This is awesome.  Can you easily add textures to shapes with this extension?


mdotedot

  • *
  • Posts: 1479
Thanks for the feedback.

@Squeeb: adding textures to shapes is easy. Finding good textures is another thing.
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: 1479
FreeForm Mode added:




Now I'm back where I started with the extrusion calculations to fill the form ..........


Edit: This version is still W.I.P, so not available online
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: 1479
YEAH !! Soled the extrusion!!

For the Extrusion Problem  I had to solve / figure out these:
* Creation of extrusion rotated the shape that I needed to correct
* Merging Extruded form and geometry faces should be zero-based
* Depth (z-position) calculation based on the extrusion-depth
* Default material only ' paints ' one face, so I was looking into dark when the face actually was correctly placed :(
  There is a bothSides = true for this!!!!
 
 
 


Now on to saving this FreeForm data and load it ...




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: 1479
Saving /  Loading and Merging the FreeForm should be done:


Click for editor:
Draw3D


Now back to the Extension and change a block so that it can load the Draw3D object(s)
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: 2159


I made a fly thingy... the "BFT Monster" from the original Temple of Idosra. I'd need some more practice to get the facial features, though. It'd be easier to use if I could click and drag objects to move them, rather than use the sliders.

This would be a lot of fun to have as a drawing app for a tablet.

mdotedot

  • *
  • Posts: 1479
AWESOME!

Quote
It'd be easier to use if I could click and drag objects to move them, rather than use the sliders.
The sliders are exactly the thing that I needed. I am just so confused with all those 3D programs with their implementations.
I get lost very fast when clicking and dragging and don't know where things are aligned.
Too many things on screen. You need to study hard before you can actually make anything.

Maybe I will revisit the editor to allow for text input as well as the sliders and maybe even make an option to drag/drop.
But to be honest I rather like to complete some demos first using this program. Also, once the tools/extensions are out to the public I want to get a feel how many people are going to use this. Maybe my personal usage will change as well and when it does it might inflict different features.

I am very pleased that you gave it a go and gave some feedback on it! Thanks mate!





« Last Edit: September 22, 2018, 02:30:35 am 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.