Posted: 28th Apr 2021 0:10
Hello all, I'd like to share a little project I started earlier this month. ( ?2021-04-0?9 ??07:16:51 )

PipeDream3D, a 3D modeling application. My first goal is to create replacement for Silo3D. Silo3D is a minefield of crash bugs and development had mostly ceased years ago. There was a recent update, but all of the show-stopper bugs I'm aware of are still there. On top of that you have to pay for the update, even if you have a Silo 2 license. Max & Maya are rubbish (in my not so humble opinion ), expensive, and riddled with bugs as well. Blender has gotten better since the 2.8 GUI update, but still not something I care to use. So, in frustration, I've decided to give making my own application a go.

[s]Currently I've only finished Viewport Control, Mesh Selection, and Mesh Manipulation:Move.[/s] (see "Change Log" & "Todo List")

Download is attached.



I've abstracted my code from AppGameKit, to facilitate porting away from AppGameKit at a later date.
As such, there is a key difference from AppGameKit, the Z axis is inverted.


[size=large]Keybinds:[/size] All keybinds are hard coded at the moment, sorry non-US-keyboard-layout people.
+ Code Snippet
    Mouse1 = Select FirstHit
    Mouse3 = Select PassThru

    Shift+Mouse1 = SelectAdd FirstHit
    Shift+Mouse3 = SelectAdd PassThru

    Ctrl+Shift+Mouse1 = SelectSub FirstHit
    Ctrl+Shift+Mouse3 = SelectSub PassThru

    Space = Cancel Section
    Ctrl+A = Select All


    Shift (while manipulating) = Snapping


    Alt + Mouse1  =  Viewport Pivot  (Pitch & Yaw)
    Alt + Mouse2  =  Viewport Dolly  (Move along Viewport Local Z Axis)
    Alt + Mouse3  =  Viewport Pan    (Move along Viewport Local X/Y Axis)


    Insert = Create Mesh
    Delete & ` = Delete Selection

    F11 = Toggle Fullscreen
    F12 = ScreenShot

    NumRow_1 = Show Info
    NumRow_2 = Show App Info
    NumRow_3 = Show Mouse Info
    NumRow_4 = Show Camera Info
    NumRow_5 = Show Viewport Info
    NumRow_6 = Show Manip Info
    NumRow_7 = Show Selection Info

    NumRow_8 = Toggle Grid Major
    NumRow_9 = Toggle Grid Minor
    NumRow_0 = Toggle ZeroGrid

    NumPad_0 = SetViewport: OrthoFree
    NumPad_1 = SetViewport: Perspective
    NumPad_2 = SetViewport: OrthoZp
    NumPad_3 = SetViewport: OrthoYn
    NumPad_4 = SetViewport: OrthoXn
    NumPad_5 = SetViewport: OrthoYp
    NumPad_6 = SetViewport: OrthoXp
    NumPad_7 = SetViewport: UV
    NumPad_8 = SetViewport: OrthoZn
    NumPad_9 = SetViewport: UVW

    , = Toggle Snapping Mode: Move
    . = Toggle Snapping Mode: Scale
    / = Toggle Snapping Mode: Rotate

    Q = SetSelectMode: Select
    W = SetSelectMode: Select & Move
    E = SetSelectMode: Select & Scale
    R = SetSelectMode: Select & Rotate

    A = SetSelectType: Vert
    S = SetSelectType: Edge
    D = SetSelectType: Face
    F = SetSelectType: Mesh


[size=large]Todo List:[/size]
  • DONE Viewport Controlling
  • DONE Mesh Selection
  • DONE Manipulator
  • DONE Collision Detection RayVsInfinitePlane
  • DONE Collision Detection RayVsTriangle
  • DONE Mesh Manipulation Move
  • DONE Mesh Manipulation Scale
  • DONE Mesh Manipulation Rotate
  • --------- Shader: Draw 3D Line
  • --------- Shader: Draw 3D Circle/Arc
  • WIP    Shader: Draw 3D Grid
  • --------- Shader: Draw Verts
  • --------- Shader: Draw Wireframe
  • --------- Shader: Faceted Rendering
  • --------- Mesh Data
  • --------- Mesh Data --> AGK_Memblock
  • --------- Vert/Edge/Face Selection
  • --------- Vert/Edge/Face Manipulation Move
  • --------- Vert/Edge/Face Manipulation Scale
  • --------- Vert/Edge/Face Manipulation Rotate
  • --------- GUI Toolbar: Numeric Editor
  • --------- GUI Toolbar: Scene/Visible/Selection Stats
  • --------- GUI Toolbar: Scene List
  • --------- GUI MainMenu & Options
  • --------- Undo/Redo System
  • --------- Custom Input Binds System
  • --------- GUI Input
  • --------- UV-Map Editing
  • --------- PassThru Selection
  • --------- Area Selection
  • --------- CreateMesh Primitives...
  • --------- Load/Save PipeDream3D Project File
  • --------- Load/Save OBJ File
  • --------- Load/Save X File
  • --------- Make PipeDream3D (AGK) Open Source


[size=large]Pipedream List:[/size] (Longterm Todo List)
  • Port PipeDream3D away from AGK
  • SubDiv Modeling
  • Texture Baking (via Lowpoly to Highpoly projection)
  • Procedural Mesh Generation
  • SDF Mesh Generation
  • Procedural Texture Generation
  • GPU Compute for Baking
  • Animation


[size=large]Change Log:[/size]
+ Code Snippet
    0.3.0 | 2021-05-25
        Manipulator meshes now have depth, instead of flat billboards.

        Mesh Manipulation: Scale.

        Rewrote/cleaned up DoManipulate() function.

        Fixed DoManipulate() HitTest-Plane Normal inaccuracy.

        WIP Manipulation Snapping [hold Shift]

        WIP Grid Drawing Shader


    0.2.0 | 2021-05-05
        Fixed RayVsPlane HitPosition inaccuracy.

        Proper Projection of RayVsPlane HitPosition onto Manipulator AxisLine.

        Mesh Manipulation: Rotation (with no gimbal lock issues)

        Screenshot() now draws lines with proper orientation.

        LoadShader from single *.glsl file.

        Manipulator now scales properly in Ortho Viewports.


    0.1.0 | 2021-04-27
        Initial release.

        Viewport Control

        Mesh Selection

        Mesh Manipulation: Position
Posted: 28th Apr 2021 1:45
Max & Maya are rubbish, expensive, and riddled with bugs as well.


Well that's subjective opinion that I for one do not share.
Posted: 28th Apr 2021 16:49
Wow, that is ambitious but I guess that reflects on the name you gave it, I dare say AppGameKit is capable of performing everything you listed but I cant see it being robust, this is going to take massive amounts of memory manipulation which is notoriously slow, good luck though, I am interested to see at what point you say "this just isn't working"

I know from experience: https://forum.thegamecreators.com/thread/220352
Posted: 29th Apr 2021 15:04
looks good Nieb
Posted: 5th May 2021 13:23
New release, version 0.2.0, download is in OriginalPost.

Let me tell ya, vector rotation is a brainf**k.

Anyhow, I finally got mesh rotation working the way I wanted. Cleaned up and refactored tones of code. Fixed a few bugs. Etc. Check the changelog for more.


...this is going to take massive amounts of memory manipulation which is notoriously slow, good luck though, I am interested to see at what point you say "this just isn't working"


Oh, I fully expect the performance to be rubbish, hence the plans to port away from AGK. I'm just trying to get a good foundation started before I go back to tinkering (being frustrated) with C++. Also, if the mesh-memblock stuff ends up looking like a lot of work, I may just skip it and wait for the port. Where I'll have direct access to mesh data. Could just make this a nice 3D placement editor that exports AppGameKit commands for all the Objects in the Scene.

The 3D Editor looks good. I take it PureBasic is handling the GUI stuffs? I spent a week or two exploring the PureBasic documentation, seeing what all it could do. Even purchased a license. But came to the conclusion that I didn't want to bother with it, I couldn't figure out using C library's with it. Looks like it's a lot of setup work to use a C library, such as SDL. And there are a few syntax decisions I didn't like, such as thing\subthing for structs, weird.

Btw, thanks for posting the minimum window size thing. Though, I think I'll just wait for the port to deal with that stuff. I don't want to complicate the code for such things.

looks good Nieb


Thanks.

Well that's subjective opinion that I for one do not share.


To each their own. I'm sure there's a load of people who are happy with whatever tool they are using, I'm not one of those people.
Posted: 5th May 2021 22:17
I take it PureBasic is handling the GUI stuffs?


Yes, PureBasic UI integrated as an AppGameKit plugin.

I couldn't figure out using C library's with it, Looks like it's a lot of setup work to use a C library


ImportC, PrototypeC, there is a bit of leg work in setting up external libs but most of us just write header converters for the bulk and hand code the rest the UI looks dated but I believe a new version is being considered that would drop support for 9x and sport a new UI lib (based off wx I hope)

Btw, thanks for posting the minimum window size thing.


No problem, plugins like that only take 5 minuets to write, another joy of PureBasic

Could just make this a nice 3D placement editor that exports AppGameKit commands for all the Objects in the Scene.


That was the plan for my editor but IMA's started popping up the more I pushed AppGameKit, something in the plugin system did not like the rapid transfer of string values over and over again so that saw the end of that, I get no such errors using Lua though! weird!

Where I'll have direct access to mesh data.


Well you got a few options there, go to the source and write the graphics engine in raw gl, tonnes of work just to open a bloody window no way I want to write a full engine with it, or an existing framework, AppGameKit is fantastic for games but not ideal for an editor so what is ... I have done a tonne of research and played with many frameworks trying to answer that question and what I have discovered that the perfect framework does not exist, each lack something that the others have but one stands out among the rest as a real contender... Raylib, in particular the following commands: DrawLine3D, DrawPoint3D, DrawTriangle3D, DrawPlane, DrawCube (other primitives) ETC or use a mesh and manipulate the Mesh data and transform structs... name a model you can not recreate with those functions and a matrix dataset, to complex for me to implement but I certainly see the power of this function set.
Posted: 10th May 2021 15:25
massive amounts of memory manipulation which is notoriously slow

I guess you are talking about memblocks wich i think aren't slow it's just the iteratians needed for it to manipulate a whole mesh and iterations are slow in AppGameKit not the aktual memblocks, not ?
Where I'll have direct access to mesh data

And with Memblocks you do have direct/full acces to the Mesh data...
Let me tell ya, vector rotation is a brainf**k.

Do you mean this ?
+ Code Snippet
		CamAngleX#=GetCameraAngleX(1)
		CamAngleY#=GetCameraAngleY(1)
		CamAngleZ#=GetCameraAngleZ(1)
		
	    CamX#=GetCameraX(1)
	    CamY#=GetCameraY(1)
	    CamZ#=GetCameraZ(1)
	    
		cosCamX#=cos(CamAngleX#)
	    sinCamX#=sin(CamAngleX#)
	    cosCamY#=cos(CamAngleY#)
	    sinCamY#=sin(CamAngleY#)
	
		dist#=2
		X#=sinCamY# * dist# * cosCamX# * dist# + CamX#
		Z#=cosCamY# * dist# * cosCamX# * dist# + CamZ#
		Y#=-sinCamX# * dist# * dist# + CamY#
Posted: 25th May 2021 17:17
New release, version 0.3.0, download is in OriginalPost.

Took a bit of a sanity break, but I'm back at it now. Spent a bit of time hemming and hawing on how I wanted snapping behavior to work. I think I've figured something out, we'll see, it's still a work in progress. Position snapping is finished, and Scale & Rotation only support Delta snapping at the moment.
Cleaned up and refactored a lot code, mainly with Manipulation.
Now, what to work on next...

That was the plan for my editor but IMA's started popping up...

I'm not familiar with the term "IMA".

RayLib was something I came across in my searching as well. Might give it another look.
Though, I'm in the mindset that I'd like to implement as much as is reasonable/practical myself rather then rely on libraries. If RayLib is just an abstraction on top of something like SDL, then I'd rather just directly use SDL.

And with Memblocks you do have direct/full access to the Mesh data.

True, in a very clumsy and indirect way.

Do you mean this?

Not quite, that's similar to the way I've done Camera controls in some of my games.
However, the pivot point for the camera is arbitrary in this app. So, I needed something more generalized. Something like so:
+ Code Snippet
FUNCTION rot3_p(Pa REF AS Vec3, Pp REF AS Vec3, A REF AS Vec3, T AS FLOAT)
    // Rotate PointA around PointP on an arbitrary Axis.    (Pa = PointA, Pp = PointPivot, A = Axis, T = Theta)

    // Get Delta.
    dPA_X AS FLOAT : dPA_X = Pa.x - Pp.x
    dPA_Y AS FLOAT : dPA_Y = Pa.y - Pp.y
    dPA_Z AS FLOAT : dPA_Z = Pa.z - Pp.z

    T = -T // @fix -Theta?

    Result AS Vec3
    Result.x = Pp.x  +  ( (A.x * A.x * (1-cos(T)) +       cos(T)) * dPA_X )  +  ( (A.y * A.x * (1-cos(T)) - A.z * sin(T)) * dPA_Y )  +  ( (A.z * A.x * (1-cos(T)) + A.y * sin(T)) * dPA_Z )
    Result.y = Pp.y  +  ( (A.x * A.y * (1-cos(T)) + A.z * sin(T)) * dPA_X )  +  ( (A.y * A.y * (1-cos(T)) +       cos(T)) * dPA_Y )  +  ( (A.z * A.y * (1-cos(T)) - A.x * sin(T)) * dPA_Z )
    Result.z = Pp.z  +  ( (A.x * A.z * (1-cos(T)) - A.y * sin(T)) * dPA_X )  +  ( (A.y * A.z * (1-cos(T)) + A.x * sin(T)) * dPA_Y )  +  ( (A.z * A.z * (1-cos(T)) +       cos(T)) * dPA_Z )
ENDFUNCTION Result