Author Topic: 3D Concepts  (Read 4128 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #45 on: May 18, 2012, 09:30:18 AM »
Hate to be a downer, but don't forget the 90:90 rule...

What's that? :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #46 on: May 18, 2012, 09:34:39 AM »
Nm, googled it. :>

Yes you're right, it's going to take a long time to finish it, and then an even longer time to troubleshoot all the bugs. :>
However hopefully I will minimise the amount of time troubleshooting takes, because this time around I have followed some good programming practices:

1) All my stuff is commented like crazy, so it's reasonably easy to see what everything does
2) Things are split up into different functions, so I think the longest single function is only about 100 lines.
3) My tabs and spacing are well thought out and make it clear to see where loops and conditionals start and end.
4) Most importantly, I've spent nearly a year working on diagrams, plans and conceptual understanding of how it ought to work.

If I test each major section (such as pseudovertex generation) carefully before moving on, hopefully the troubleshooting needed at the very end will be kept to a minimum. :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #47 on: May 18, 2012, 09:39:28 AM »
It's crazy how much time has gone into this.

I started working on the 3D engine in January 2011! 

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: 3D Concepts
« Reply #48 on: May 18, 2012, 10:14:53 AM »
You did leave for a while though :D

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #49 on: May 18, 2012, 10:35:38 AM »
That's true.  The conceptual stuff has always been on my mind though.

There are heaps of threads on this forum related to the 3D stuff.  The original parallax thread, the "problems with parallax" thread, the Faces thread, and now this thread... no doubt there are more too.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #50 on: May 18, 2012, 01:36:11 PM »
Excited to try out the drawing of pseudovertices tonight.. :D
« Last Edit: May 18, 2012, 05:06:55 PM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #51 on: May 18, 2012, 07:48:17 PM »
The pseudovertices go flying all over the place and don't display correct behaviour at all. :<

Hmm..

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #52 on: May 18, 2012, 08:01:15 PM »
I've set the name of the single asteroid in my test level to be equal to to X-coordinate of pseudovertex ID 0 on edge 9.

One thing I notice is that it seems to change very infrequently.  Expected behaviour is that it should be shifting around a lot, especially when the camera moves or zooms.


Hmm...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #53 on: May 18, 2012, 08:04:25 PM »
Saw a -900 value.. and a 16817.

That's beyond the range of the objects.
So maybe some of the maths is wrong.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #54 on: May 19, 2012, 06:14:02 PM »
Working!!!

w000000ttt :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #55 on: May 19, 2012, 06:19:13 PM »
Here it is working:





The big colourful dots are the vertices that form 3 cubes, two of which are rotating.

The little red dots are the pseudovertices. :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #56 on: May 19, 2012, 08:49:31 PM »
So now I'm thinking about function HideVertices().

I've realised that at the moment, the 3D intersection point of a vertex is known only briefly during the generation of the pseudovertices.  After that this information is discarded, and all that is left is the 2D equivalent.

I can't check if a 2D point is "behind" anything.  The whole concept of "behind" implies 3 dimensions.


So maybe I need to do the hiding of vertices in-loop during the generation of pseudo vertices.  I could pass the 2D coordinates to a function that checks if the pseudo-vertex is inside or outside any 2D face polygons, then for any faces that the pseudovertex is inside I could calculate the coordinates at which a line drawn between the camera and the tested pseudovertex intercepts with the face.  If the interception point is closer to the camera than the pseudovertex itself, the pseudovertex should be hidden.. and in fact, doesn't even need to be added in the first place.

So rather than generating all the vertices then deactivating some of them, I can try to generate them all but selectively not generate any ones that would be behind faces.

That system makes more sense.


So basically function HideVertices() will be called from deep within the Pseudovertex generator's loops.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: 3D Concepts
« Reply #57 on: May 20, 2012, 12:02:42 AM »
Annikk, you know when you say 3D, do you mean, able to scroll around the Eufloria game world, so an Asteroid would look like a ball, or are you doing it so it's like Fl0w?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: 3D Concepts
« Reply #58 on: May 20, 2012, 11:57:07 AM »
It's a 3D engine comprised of lines and sprites.  It won't transform things like flowers and seedlings into 3D.

Asteroids appear like flat discs that sit on the plane z=0.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: 3D Concepts
« Reply #59 on: May 20, 2012, 01:13:01 PM »
So like fl0w? :P I think it would still be good though, could bring some great storyline ideas to mind, I have a few already.