amiga.org
     
iconAll times are GMT -6. The time now is 06:46 PM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Operating System Specific Discussions » Amiga OS » Amiga OS -- Development » My Amos-vector question moved here

Amiga OS -- Development This particular forum deals with issues regarding development for all versions of AmigaOS.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-21-2004, 06:25 AM   #1
GreatLor
Too much caffeine
Points: 4,031, Level: 40 Points: 4,031, Level: 40 Points: 4,031, Level: 40
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Posts: 72
Default My Amos-vector question moved here

First I must say that yesterday I came up with a quicker way to do the rotation (no use of square-roots - boy was that STUPID ?! :-) )

If anyone has any experience with vector-programming please give your opinions, here fallows; first the intit for the base-vectors:

ax#=50
ay#=0
az#=0

bx#=0
by#=-50
bz#=0

cx#=0
cy#=0
cz#=50

here is the main loop:

do
gosub rotate_ab
gosub rotate_bc
gosub rotate_ca
wait vbl
cls 0 ; Double-buffering is not important right now
loop

Here's the 'rotate_ab' subroutine:
; I use array 'siin#()' to store some sinus values (it's faster)

rotate_ab:

;two coordinate vectors for base vector a's new pos. (rotation)

a1x#=siin#(91)*ax#
a1y#=siin#(91)*ay#
a1z#=siin#(91)*az#
b1x#=siin#(1)*bx#
b1y#=siin#(1)*by#
b1z#=siin#(1)*bz#

;two coodinate vectors for base vector b's new pos.

b2x#=siin#(91)*bx#
b2y#=siin#(91)*by#
b2z#=siin#(91)*bz#
a2x#=siin#(1)*-ax#
a2y#=siin#(1)*-ay#
a2z#=siin#(1)*-az#

; now adding the two vectors of each base vector to them

; vector a

ax#=a1x#+b1x#
ay#=a1y#+b1y#
az#=a1z#+b1z#

; vector b

bx#=b2x#+a2x#
by#=b2y#+a2y#
bz#=b2z#+a2z#

return

; and two similar subroutines for the rotations around the two other axis (which I will not include here).

So is THIS the way others do vector rotations or are there faster (and more complicated) ways ?

Thanx in advance ! (hope somebody answers this :-D )
GreatLor is offline   Reply With Quote
 

Bookmarks

Tags
amosvector , moved , question

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running AMOS 3D and AMOS Creator on AGA SamOS39 Amiga Software Issues and Discussion 8 02-18-2009 07:44 AM
#amiga.org has moved (again) Blomberg Amiga.org site announcements 18 02-03-2008 01:55 PM
Amix Wiki moved across the Atlantic Failure General chat about Amiga topics 1 01-09-2008 06:06 PM
ExoticA website has moved. buzz Amiga Gaming 0 03-17-2006 02:31 PM
Amos, Easy Amos or Amos Pro or maybe Blitz Basic? CyberStorm Amiga Software Issues and Discussion 7 12-11-2004 11:06 PM