Define a 3D-Depth

You must understand the Game Editor concepts, before post here.

Define a 3D-Depth

Postby Hblade » Sun Jun 24, 2012 5:15 am

How would I go about making a Z-Depth for a 3D Wireframe (Very very basic model), all created with canvas? I'd like to use something like this to create a wired 3D world. It would be very very interesting
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Define a 3D-Depth

Postby skydereign » Sun Jun 24, 2012 5:37 am

Well, what is the wireframe? Assuming you want something like a cube, then to represent it in 3 space, you would need to have points that have an x, y, and z values. The cube is comprised of 8 of these points. So, either you can have 8 sets of 3 ints in an array, or perhaps declare a structure to represent a point in 3 space (and create an array of 8 points). Either way, it is pretty standard.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Define a 3D-Depth

Postby Hblade » Sun Jun 24, 2012 3:26 pm

I"ll use this information. Thanks
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Define a 3D-Depth

Postby SuperSonic » Tue Jun 26, 2012 2:15 am

Hblade, if you get very far with this, please let me know. I've been trying to get into 3d programming as well :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Define a 3D-Depth

Postby Hblade » Sat Jun 30, 2012 12:20 am

So far I've gotten nowhere. I can't figure out the algorithm. And I won't have internet for about a week or 2 so that sucks xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Define a 3D-Depth

Postby savvy » Thu Jul 05, 2012 5:03 pm

You need to have an array represented as so...
vertices[numberofpoints][2][10];
coordinates
[1][[0] being x value
[1][1] being y value
[1][2] being z value

connections
[2][number] being what a line is drawn to, example:

vertices[0][1][0,1,2] = 1;
vertices[1][1][0,1,2] = 5;
then
vertices[0][2][0] = 0; <- Makes it connected to the point in vertices[0]

Then for drawing it you need to use projection, sin, cos, tan etc, to place the points prospectively on the canvas.

!!EDIT!!: You need to plot the poitns first, THEN use lineto to draw the lines in using the vertices connection in the array.

savvy

PS: I will eventually work on such a projection algorithm, but right now I'm working on something else. XD
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Define a 3D-Depth

Postby Hblade » Fri Jul 06, 2012 9:37 am

Sounds insanely copmlicated haha. But I bet once you understand it its simple.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Define a 3D-Depth

Postby savvy » Fri Jul 06, 2012 9:40 am

It's not too complicated to grasp the concept, its more the math behind placing the depth of the coordinates that is the issue!
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Define a 3D-Depth

Postby Hblade » Sat Jul 21, 2012 9:23 pm

True
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron