|
-
Nov 15th, 2004, 06:09 AM
#1
Thread Starter
Addicted Member
3d principals??????
Well guys, as i know everything in 3d is made from triangles. Im not really good in thinking mathematically but i can think more theoric. If u can, will u plz formulate a formula of how triangles connect to each other like its in a cube.(And should i use lines to form a triangle or shape objects).It will be in VB, im trying to make a 3d engine without DirectX or OpenGL.
Tnx in advance
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Nov 15th, 2004, 07:34 AM
#2
Not NoteMe
Once you've defigned the triangles that can make up a cube (using 3D coordinates to represent the vertices) then you need to 'project' the cube/triangles onto the screen in order to draw them.
I'm not exactly sure how much you know, so i'll start by explaining how to represent a cube using triangles.
Basically, picture a dice (die?) which has 6 sides (faces). Each of those sides is a square, and can be represented by two triangles that share 2 corners of the square:
Code:
-----
| /|
| / |
| / |
|/ |
-----
So now, if you have a square, with vertices as 3D coordinates, you'd split it into triangles as above, only using 3D coordinates as the triangles verticies (i used a 2D square as above for explanation).
Next you need to work out where these square are on a cube.
You'd want one square for each side/face of the cube.
This would be done in a similar way to splitting a square into two triangles. i.e. the squares would be defigned using the vertices of the cube.
If you can work that out then you now have 6 squares in 3D space, one for each face of the cube. Splitting those into trianges and you have 12 trianges that together represent/depict a cube.
Since this is in 3D space you need to work out where to draw them on screen.
There are many algorithms that do this, some more complicated than others. The most basic is an orthographic projection.
Basically you ignore one coordinate, and just use the others. So say you wanted the XY projection (could be thought of as looking down the z-axis at the origin) these coordinates would map as follows:
(0,0,0) -> (0,0)
(12,61,665) -> (12,61)
This is because you only consider the X (first) and the Y (second) value of the coordinate.
If you wanted the XZ orthographic projection you'd take the 1st and 3rd coordinate.
As for rendering triangles once you have them in 2D screen coordinates, there are many algorithms. The simplest for testing would be to draw lines connecting the vertices of the triange. More complicated would be to fill in the triangle with a colour. A more complicated method would be texture mapping.
Ask of you want any more help.
Last edited by SLH; Nov 15th, 2004 at 08:16 AM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 15th, 2004, 07:42 AM
#3
Thread Starter
Addicted Member
Thank u very much. Ill try to understand what you've just said(guess my brain cpu works slower than others'. )
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Nov 15th, 2004, 08:29 AM
#4
Not NoteMe
Lol, ok. If you need me to explain anything better, i'll do my best.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 15th, 2004, 08:49 AM
#5
Thread Starter
Addicted Member
Well... At least can you give an example? Do I have to draw lines to compose a triangle or should I use "shape object"? And... How can I rotate the screen? Or instead can u help me do the basic modeller? Pleaaase . I also posted a thread in "Project Requests" forum.
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Nov 15th, 2004, 09:03 AM
#6
Not NoteMe
How experienced are you with programming in general?
Before we try and get a moving image, let's try a static one first.
Firstly you'll need a way of representing a vertex.
This could be a class with three elements, x, y and z. All of type float.
Next you need to work out in what vertices would be for a cube (you'd need 8 of 'em.
You'll need a data structure for this as well. It could be an array of vertices if you like.
You can define a triangle object, and (if you can't co from cube straight to a list of trianges) a square object.
Once this is done need to work out how to draw your objects. This depends a lot on the programming language you're using, and your preference. I'd use some sort of line-drawing method though, since this can easily be extended/changed later.
As for where to draw the lines i've explained that in my first post (projections).
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 15th, 2004, 09:13 AM
#7
Thread Starter
Addicted Member
Well, im not experienced in graphics in VB but good in trojans with API calls; i finished a book that teaches VB, and have been doing things in VB(mostly trojan, virus, keylogger... But never graphical stuff) for 3 years. I really havent done so many complicated things in fact. So u can call me.... Newbie .
Last edited by kill_bill_gates; Nov 15th, 2004 at 10:30 AM.
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Nov 15th, 2004, 12:51 PM
#8
Not NoteMe
There are lots of examples for drawing using VB on the internet, just google or seach these forums for examples.
Since trojans, virus' and keylogger's annoy me that's the last bit of help you're getting.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 15th, 2004, 12:58 PM
#9
Thread Starter
Addicted Member
Well
Tnx Anyway for The Advices(Althought wasnt very useful)
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|