 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jon Lennart Aasenden Guest
|
Posted: Tue Apr 27, 2004 12:49 am Post subject: old school 3d |
|
|
How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and down is
it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so cool
on the amiga back in the 80'ies
Jon Lennart Aasenden,
Norway
|
|
| Back to top |
|
 |
Andi Guest
|
Posted: Tue Apr 27, 2004 7:53 am Post subject: Re: old school 3d |
|
|
Your dot has 3 coordinates: (-10, -10, 10). After rotating it around
whatever axis it has still 3 coords. The formula you gave returns only one
value. What you need is a set of 3 formulas giving you 3 new coords of your
dot. These 3 formulas envolve (if you want to rotate by arbitrary degrees)
the sin and cos functions.
For 2D rotation (with 2 coords xold and yold) these formulas are:
xnew := xold*cos(angle) - yold*sin(angle);
ynew := xold*sin(angle) + yold*cos(angle);
In 3D rotation things become a lot more tricky because it depends on the
order in which you perform the rotations around the 3 axes: first around x,
then y, then z? If you change this order your dot will finally have a
different global position! If you want to do some research on this look for
"Euler angles".
"Jon Lennart Aasenden" <post_nospam_nojunk (AT) hexmonks (DOT) net> schrieb im
Newsbeitrag news:408dae06 (AT) newsgroups (DOT) borland.com...
| Quote: | How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and down is
it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so cool
on the amiga back in the 80'ies
Jon Lennart Aasenden,
Norway
|
|
|
| Back to top |
|
 |
Rene Tschaggelar Guest
|
Posted: Tue Apr 27, 2004 6:22 pm Post subject: Re: old school 3d |
|
|
Jon Lennart Aasenden wrote:
| Quote: | How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and
down is it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so
cool on the amiga back in the 80'ies
|
I have some pages concerned with rotations.
http://www.ibrtses.com/delphi/index.html
http://www.ibrtses.com/opengl/index.html
Rene
--
Ing.Buro R.Tschaggelar http://www.ibrtses.com
Your newsgroups @ http://www.talkto.net
|
|
| Back to top |
|
 |
Jon Lennart Aasenden Guest
|
Posted: Tue Apr 27, 2004 9:08 pm Post subject: Re: old school 3d |
|
|
Thanks for the tips :)
But i wanted native delphi 3d code, not opengl or directx :)
Jon Lennart Aasenden
"Rene Tschaggelar" <ee123123wqe12 (AT) sd242323 (DOT) com> wrote
| Quote: | Jon Lennart Aasenden wrote:
How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and
down is it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so
cool on the amiga back in the 80'ies
I have some pages concerned with rotations.
http://www.ibrtses.com/delphi/index.html
http://www.ibrtses.com/opengl/index.html
Rene
--
Ing.Buro R.Tschaggelar http://www.ibrtses.com
Your newsgroups @ http://www.talkto.net
|
|
|
| Back to top |
|
 |
Guest
|
Posted: Tue Apr 27, 2004 10:13 pm Post subject: Re: old school 3d |
|
|
impressive:
http://www.geocities.com/peter_bone_uk/engine3d.html
"Jon Lennart Aasenden" <post_nospam_nojunk (AT) hexmonks (DOT) net>
| Quote: | Thanks for the tips :)
But i wanted native delphi 3d code, not opengl or directx :)
Jon Lennart Aasenden
"Rene Tschaggelar" <ee123123wqe12 (AT) sd242323 (DOT) com> wrote in message
news:xn0dhj4k9000000v (AT) ibrt_7 (DOT) ..
Jon Lennart Aasenden wrote:
How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and
down is it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so
cool on the amiga back in the 80'ies
I have some pages concerned with rotations.
http://www.ibrtses.com/delphi/index.html
http://www.ibrtses.com/opengl/index.html
Rene
--
Ing.Buro R.Tschaggelar http://www.ibrtses.com
Your newsgroups @ http://www.talkto.net
|
|
|
| Back to top |
|
 |
Jon Lennart Aasenden Guest
|
Posted: Wed Apr 28, 2004 10:29 pm Post subject: Re: old school 3d |
|
|
thanks!
Jon Lennart Aasenden
<tt (AT) atonline (DOT) de> wrote
| Quote: | impressive:
http://www.geocities.com/peter_bone_uk/engine3d.html
"Jon Lennart Aasenden" <post_nospam_nojunk (AT) hexmonks (DOT) net
Thanks for the tips :)
But i wanted native delphi 3d code, not opengl or directx :)
Jon Lennart Aasenden
"Rene Tschaggelar"
news:xn0dhj4k9000000v (AT) ibrt_7 (DOT) ..
Jon Lennart Aasenden wrote:
How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and
down is it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so
cool on the amiga back in the 80'ies
I have some pages concerned with rotations.
http://www.ibrtses.com/delphi/index.html
http://www.ibrtses.com/opengl/index.html
Rene
--
Ing.Buro R.Tschaggelar http://www.ibrtses.com
Your newsgroups @ http://www.talkto.net
|
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Thu Apr 29, 2004 9:55 pm Post subject: Re: old school 3d |
|
|
Your formula (although wrong) seems to refer to the perspective projection.
In a 3D transformation, your point goes to a new 3D point, so it still has 3
coordinates. When doing the final transformation towards the screen, the Z
is usually disregarded, or simply used to scale the other axes.
You can use quaternions or Euler angles to do the rotation of 3D points, and
combine the resulting matrices for scaling, translation and rotation into
one transformation matrix (3x3).
Nils
"Jon Lennart Aasenden" <post_nospam_nojunk (AT) hexmonks (DOT) net> wrote
| Quote: | How hard is it to rotate a point in 3d space in pure delphi?
Say a dot: -10,-10,10
and i want to rotate the values -40 on the z axis? (thats left and down is
it not)
I seem to remember the formula for 3d was: result:=(x * y) / depth?
Any info is welcome
Just want to code the old rotating, non-filled, line cube that was so cool
on the amiga back in the 80'ies
Jon Lennart Aasenden,
Norway
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|