Author Topic: 3D Concepts  (Read 4101 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
3D Concepts
« on: January 10, 2012, 04:30:08 PM »






















See this discussion for more detail on this method.

























To be continued.
« Last Edit: January 14, 2012, 02:00:33 AM by annikk.exe »

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: 3D Concepts
« Reply #1 on: January 10, 2012, 04:44:07 PM »
Starting on this again are we? :)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: 3D Concepts
« Reply #2 on: January 10, 2012, 05:09:45 PM »
Apparently so.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: 3D Concepts
« Reply #3 on: January 10, 2012, 07:39:18 PM »
Are you going to remake this, or? :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #4 on: January 11, 2012, 09:43:11 AM »
I want to, but my understanding of what is required isn't comprehensive enough.  So first I will make heaps of diagrams to help me visualise what needs to be calculated. :>  The maths behind it all is pretty scary.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #5 on: January 11, 2012, 01:32:05 PM »
Drawing in perspective is hard!

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: 3D Concepts
« Reply #6 on: January 11, 2012, 01:45:34 PM »
I want to, but my understanding of what is required isn't comprehensive enough.  So first I will make heaps of diagrams to help me visualise what needs to be calculated. :>  The maths behind it all is pretty scary.

Yeah... The maths are very complicated :o

But I've begun, if you want to continue it. You sorta just kicked me off. The file has a nice clean array system, making the verticles objects instead of just a ton of variables.
Feel free to use it and expand it :)

I have added 4 faces, triangle, quad(rectangle), pentagon and hexagons. They make a face that includes the verticles of the face(which is logical) and you can call the verticles from each individual face or call each individual verticle.
I haven't fully completed the parralax effect(it works, but fails at calculating properly), I don't think you will need it for further stuff either though :P

If you have any question regarding the stuff inside, ask :)
« Last Edit: January 11, 2012, 02:07:12 PM by Aino »

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: 3D Concepts
« Reply #7 on: January 11, 2012, 01:47:35 PM »
Posted it, but I guess you've started already :P

Drawing in first person perspective wouldn't be that hard I guess, if you have the center located at your rotation(yaw and pitch) and then drawing everything according to it. Simpler said than done though...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #8 on: January 11, 2012, 02:15:03 PM »
Parallax and 3D are different, I know what you mean though. :>

The tricky parts to calculate are coming in diagrams soon.  The next few diagrams will consider the problem of "how do we know if a vertex is "inside" a face?" -done
Then we'll consider the problem of "how do we tell if a vertex that was found to be inside a face, is in front of the face (and should be shown) or behind the face (and hidden)? -done
Then we'll introduce the concept of pseudo-vertices. -done
Then we'll consider the problem of calculating where pseudo-vertices should be created, and how to draw or not draw edges depending on the number and type of pseudo-vertices they contain.
Then we'll look at what we can do in the case where a face covers an edge, but doesn't cover either of the edge's connecting vertices.

Finally I'll make some diagrams with test configurations, EG a pyramid in front of a cube, and plot out the default behaviour, the expected behaviour, and how the systems we put in place in previous steps will produce the expected behaviour.

Then I'll make some function templates.
I'll work out which variables need to be sent and returned from the function templates.
Then I'll begin filling in the function templates with code.
I'll be testing as I go... if I have any problems whatsoever understanding what needs to be calculated I will stop and produce more diagrams to make it clearer to myself.
Then finally I hope to end up with a 3D engine. :>

Once that's done I can start with other cool projects such as formalising the way objects are expressed in the engine, implenting support for changing object sizes, face alpha (transparency), reflections, and of course actually building some objects!


An object editor is basically going to be required if we want to make anything more complex than primitives such as squares, triangles, cubes and pyramids.
Aino, I've no idea what the final requirements of an object template will be, but I'm strongly hoping that once I've fleshed it out a bit more, you would be the one to build the 3D object editor for it.  :>  It would need to allow the user to create and adjust vertex positions in 3D, rotate the object round so that you can look at it, the ability to declare edges and faces, etc.  It would need to output a text or lua file which would contain the object function.  It would also ideally need to be able to load an object from an existing template file, so that existing objects can be edited.  And it also needs to be easy to use!

The editor would run using the same 3D engine that the objects would be displayed in, so I need to finish my engine before you'll be able to get properly involved in that project.  Hopefully all this conceptual discussion is sufficiently stimulating to get you thinking about the problem, at least. :>
« Last Edit: January 12, 2012, 12:09:58 PM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #9 on: January 12, 2012, 12:17:05 PM »
Are you guys understanding the diagrams so far by the way? :>

As per previous post, Aino, do you have any thoughts on eventually building a 3D object editor? :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: 3D Concepts
« Reply #10 on: January 12, 2012, 01:41:45 PM »
I understand the diagrams perfectly clear, because I was aware of the stuff posted, but that's just me...
I can make a 3D object editor, but first I need a 3D engine to do it on. :)

Also, are you making this for a future map in Eufloria or just for the sake of learning how to do it? :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #11 on: January 12, 2012, 11:04:34 PM »
I definitely want to release something playable eventually.  Very little idea what form it will take yet.

I need to make, at minimum, another 6 or so diagrams before the basic part of the engine is fully explained.  I'll get those done soon..

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #12 on: March 28, 2012, 05:33:12 PM »
1.  Get vertex, edge and face data.
2.  Compare all edges to calculate all possible pseudo-vertices; create a pseudo-vertex if the lines intersect.  Check distance of the lines' 3D intersection points from the camera to calculate which edge a pseudo-vertex should be assigned to (always the further away of the two edges).
3.  Use face data to calculate which vertices and pseudo-vertices should be hidden.  All vertices begin visible; if a vertex is behind a face, it gets hidden.  If it's in front of the face, no change is made.  That way only the vertices that aren't behind any faces will remain visible.
4.  For each edge, sort the vertices and pseudo-vertices so that they go from one end of the edge to the other.
5.  Draw each edge by only drawing between two visible vertices/pseudovertices.  These should ALWAYS arise in pairs; if no twin can be found, do not draw.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: 3D Concepts
« Reply #13 on: March 28, 2012, 10:36:34 PM »
ANNIKK'S BACK!

YAY! Maybe we'll see something happening here again!

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: 3D Concepts
« Reply #14 on: March 30, 2012, 07:57:15 PM »
It's hard to tell how many people actually read things on this forum, or appreciate the efforts of the map-makers, since so few seem to actually post comments. For what it's worth, I, for one, find this thread fascinating and look forward to seeing these concepts developed further. Keep it coming!