Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 3D Engine based on vectors -- HELP!
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
{PseudoNymX}




PostPosted: Tue May 22, 2007 8:23 am   Post subject: 3D Engine based on vectors -- HELP!

Okay... First off, I want to just say hi, seeing as it's my first post here... I'll cut to the chase.

I'm currently trying to code a 3D engine based on vectors. It's pretty simple, in concept. One point represents the object, and from that one point sprouts whatever number of vectors (working with four at the moment, for simplicity's sake) with the parameters "xa", "ya", and "mag", representing the angle of the vector from the X-axis and Y-axis, and the magnitude (length) of the vector, respectively.

The object (point) they sprout from has x, y, and z co-ordinates, an x-angle and y-angle measuring rotation, as well as a z-angle. Changes made to this object apply to the vectors sprouting from it. (e.g. rotate the object, all vectors sprouting from it are rotated the same way, etc.)

I should mention that I use an odd (or so my colleagues seem to think) graphing system; my x-axis goes from left to right, my y-axis goes from top to bottom, and my z-axis measures depth (forward to back). It makes sense to me, but I'm told it isn't the norm. Anyways...

I've already figured out how to turn the 3D points into 2D points, that was relatively easy... What I CAN'T figure out is how the z-axis of the OBJECT affects the vectors sprouting from it. I know that:
(1) It shouldn't affect the X co-ordinates
(2) It SHOULD affect Y and Z co-ordinates in a circular pattern
(3) It's bugging the hell out of me trying to figure it out

I'm coding it in Turing (I know, I know, but it's a final project for school, Turing is mandetory) but since it applies to any language really, I figured I'd post it here. If anyone has any prior experience with this sort of thing, PLEASE contact me ASAP at quinnster2000@hotmail.com as I'm kind of on a deadline. Thanks. (I'll post my code as well just in case someone wants to look at it)



3D physics - vectors.t
 Description:

Download
 Filename:  3D physics - vectors.t
 Filesize:  5.93 KB
 Downloaded:  114 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
zylum




PostPosted: Tue May 22, 2007 2:24 pm   Post subject: RE:3D Engine based on vectors -- HELP!

A much simpler approach would be to use vectors for everything. And by vectors I mean vectors in 3-space. So the location of each object would be represented by a vector (x, y, z) as would each point sprouting from the position vector. I would think using angles and a magnitude would make it harder to do various 3D manipulations such as cross and dot product for things such as back face culling and lighting.

I know that doesn't really answer your question but it could help. btw here's an example of an engine I made a while back though it's not quite refined yet... http://www.compsci.ca/v3/viewtopic.php?t=9639
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: