Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 12th, 2005, 3:57 PM   #11
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
I'll be doing it in Turing anyways (for school).


And I don't think using a 3d graphics library would teach me HOW it works or the vector algebra directly behind it. It would probably only teach me the obvious, besides examples of how I could layout the user-accessable side of the module.
Sane is online now   Reply With Quote
Old Oct 13th, 2005, 9:36 AM   #12
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
I've tried google, without much success (mostly links to OpenGL stuff). Have any links to the actual math behind 3 dimensions?
Sane is online now   Reply With Quote
Old Oct 13th, 2005, 9:54 AM   #13
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
It is mostly linear algebra and analytic geometry.

Nate Robins' demo proggys shed quite a bit of light on the behavior (sometimes it gets confusing with shading, light position, *perspectives*, etc. etc. in OpenGL) of objects and environment in OpenGL
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty

Last edited by stevengs; Oct 13th, 2005 at 10:12 AM.
stevengs is offline   Reply With Quote
Old Oct 13th, 2005, 10:46 AM   #14
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
YESSSS I DID IT!

var vectors : array 1 .. 8 of array 1 .. 3 of int

vectors (1) (1) := - 20
vectors (1) (2) := - 20
vectors (1) (3) := - 20

vectors (2) (1) := 20
vectors (2) (2) := - 20
vectors (2) (3) := - 20

vectors (3) (1) := - 20
vectors (3) (2) := 20
vectors (3) (3) := - 20

vectors (4) (1) := 20
vectors (4) (2) := 20
vectors (4) (3) := - 20

vectors (5) (1) := - 20
vectors (5) (2) := - 20
vectors (5) (3) := 20

vectors (6) (1) := 20
vectors (6) (2) := - 20
vectors (6) (3) := 20

vectors (7) (1) := - 20
vectors (7) (2) := 20
vectors (7) (3) := 20

vectors (8) (1) := 20
vectors (8) (2) := 20
vectors (8) (3) := 20

procedure draw_object (vectors : array 1 .. 8 of array 1 .. 3 of int, x, y,
        povX, povY : int, z : real)

    var vecX, vecY, xAng, yAng : int

    for point : 1 .. 8
        vecX := x + round (vectors (point) (1) * z)
        vecY := y + round (vectors (point) (2) * z)
        xAng := round ( (povX - vecX) / (vectors (point) (3) / z))
        yAng := round ( (povY - vecY) / (vectors (point) (3) / z))
        drawdot (vecX + xAng, vecY + yAng, 7)

    end for

end draw_object

for i : 1 .. 50
    cls
    draw_object (vectors, 100 + (i * 7), maxy div 2, maxx div 2, maxy div 2,
        i / 25 + 1)
    delay (100)
end for


That draws a cube getting closer to the screen while scrolling from left to right.

The function is called with a point of view, and an x, y, z offset. Then it takes the vector points of the cube and draws it three dimensionally.

I did it without any learning resources as well!
Sane is online now   Reply With Quote
Old Oct 13th, 2005, 11:03 AM   #15
Brokenkingpin
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 Brokenkingpin is on a distinguished road
ok now make it rotate lol
Brokenkingpin is offline   Reply With Quote
Old Oct 13th, 2005, 11:29 AM   #16
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
yeah, some juicy model transformations (lotsa matrices).
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Oct 13th, 2005, 11:29 AM   #17
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
some juicy model transformations (lotsa matrices).
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Oct 13th, 2005, 12:04 PM   #18
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
double post
Polyphemus_ is offline   Reply With Quote
Old Oct 13th, 2005, 12:47 PM   #19
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
impressive
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 13th, 2005, 1:04 PM   #20
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
"now make it rotate"

I already did.

Check my function description. The xPov will rotate it on the x-axis. The yPov will rotate it on the y-axis dependant on where the x and y was passed in relation to those points-of view. Then the z will change the distance from the screen, and x and y where it actually is on the screen.

I think it's pretty much flawless as well. Only like 10 lines too.

Now I just need a 3d model to extract the pixel data from to test it on.
Sane is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC