View Full Version : Calculating sprite angles
Guest
12-12-2000, 04:00 AM
Hello. I'm not new to the net or the
BUILDing scene, just new to this particular
message board. http://www.3drealms.com/ubb/images/icons/smile.gif
I was wondering if somebody here can explain
to me the mathematical formula for taking an
actual angle and translating it into a
number to turn a sprite to. I'm sorry to
admit it, but I'm stumped.
I mean, like if I wanted to make a sprite
face at _exactly_ 15 degrees, what formula
would I use to convert 15 into the 2048
degree system that BUILD uses?
Manson
12-14-2000, 02:26 PM
This is highly EDuke related, try the EDuke forum.
AnyWay:
512/90=5,6889
5,6889*15=85 - Build angle
Short:
Multiplie your degrees by 5,6889 and you have the same angle in Build/Duke
------------------
cyborg
12-14-2000, 08:28 PM
Originally posted by Manson:
This is highly EDuke related, try the EDuke forum.
What utter rubbish. This is highly related to every single Build game ever made - seeing as the same angle system is used for each.
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
Manson
12-15-2000, 03:49 AM
Then I don't know the old Duke cons...
Could you set an actor to a specific angle in old duke?
------------------
Guest
12-15-2000, 11:21 AM
No, you can't.
Usurper
12-15-2000, 11:31 AM
Yes, you can. Shift + < or > in 2d mode.
------------------
Usurper
DN3D RTCM (http://dukertcm.totalconversions.com)
The slacker has awakened!
cyborg
12-15-2000, 06:47 PM
Originally posted by Manson:
Then I don't know the old Duke cons...
Just where did CONs become involved here?
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
Dukefan
12-16-2000, 12:51 AM
Originally posted by Manson:
This is highly EDuke related, try the EDuke forum.
AnyWay:
512/90=5,6889
5,6889*15=85 - Build angle
Short:
Multiplie your degrees by 5,6889 and you have the same angle in Build/Duke
That math doesn't work if you're in the U.S. If so, change the commas to decimal points. Just FYI.
------------------
-Dukefan
E-Mail: duke-nukem@home.com
-Or: faceless007@yahoo.com
AOL IM: LurkerFilz
"No opinion is worth burning your neighbor for." --Pierre Bayle
Manson
12-18-2000, 07:44 AM
Originally posted by cyborg:
Just where did CONs become involved here?
What else would the purpose be?
Try reading the 1st post.
------------------
cyborg
12-18-2000, 09:15 AM
Originally posted by Manson:
What else would the purpose be?
Try reading the 1st post.
LOL, why don't you try reading yourself?
Hello. I'm not new to the net or the
BUILDing scene, just new to this particular message board.
I was wondering if somebody here can explain
to me the mathematical formula for taking an
actual angle and translating it into a
number to turn a sprite to. I'm sorry to
admit it, but I'm stumped.
I mean, like if I wanted to make a sprite
face at _exactly_ 15 degrees, what formula
would I use to convert 15 into the 2048
degree system that BUILD uses?
Now just what is so implausable about wanting to know the angle in degrees of a sprite when building a map?
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
Manson
12-19-2000, 03:23 AM
OK, Teknoman, what do you need the math for?
Guest
12-19-2000, 02:16 PM
It is pretty clear buy his first post that he is using the con files.
The answer to it is that you can't set an angle in normal duke con files. You have to use eduke. You can only rotate the sprites in the original dukes. In eduke, just use the setvar command.
cyborg
12-19-2000, 04:38 PM
If anything I would have said he was using a modified Build source - if he was using CONs he would have probably meantioned this.
he also asked for a mathmatical formula - not for a specific command. If he didn't know how to make an actor change angle in the CONs using the stanard values why on earth would he then complicate things by asking the conversion to degrees?
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
Usurper
12-19-2000, 11:43 PM
Maybe I'm on crack, but I thought he meant build. In cons, you're more likely to want to turn an object until it's facing something, then make it stop turning, not turn it until it's at a particular angle. A specific angle implies an aesthetic placement in build.
------------------
Usurper
DN3D RTCM (http://dukertcm.totalconversions.com)
The slacker has awakened!
Manson
12-20-2000, 03:06 PM
Yes, but that sucks really, cos it takes time.
Besides: What do you need that math for in build? Can't you just put up the sprites, and see if it looks right?
------------------
cyborg
12-21-2000, 03:27 PM
Originally posted by Manson:
Yes, but that sucks really, cos it takes time.
Besides: What do you need that math for in build? Can't you just put up the sprites, and see if it looks right?
Again: if he didn't know the CONS why ask for the formula and not the command?
Also what do you need the maths for in the CONs? There is no good reason to work in 360 degrees as opposed to 2048.
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
cyborg
12-22-2000, 02:58 PM
Originally posted by Teknoman:
Gawd, I didn't expect this to happen...this
NEVER happens on the board I'm used to
(dukeworld).
That's because not nearly as many people visit.
So I came here asking if anybody knew the
numbers, because I'm not in the mood to
spend the next few days reading through
Ken Silverman's source code to find out for
myself.
Get an IDE that colourises comments then - it took me about two minutes to find the text that explains his 2048 degree system - and his sine tables for it.
Anyways, you're sure it's 5.6889? I figure
I'm gonna have a _lot_ of sprites to move
as this level progresses and I'd appreciate
BUILD perfect math (as in "if you pressed
"O" on this light switch sprite, it'd be
rotated to...") so I wouldn't have to go
through the level and manually fix
everything.
Can't you do the maths for yourself? 2048/360? You're not going to get perfection unless you are rotating to one of the 2048 angles there is a sine table for because a degree of inaccuracy will creep in. This cannot be avoided unless you increase the number of angles permittedfor sprites.
------------------
Duke Nukem Resources for Totalconversions and Modifications (http://dukertcm.totalconversions.com)
Build game information on...
Game Connection (Internet play) (http://dukertcm.totalconversions.com/Knowledge_Base/Base_Game-Connection.shtml)
Sound card setup (http://dukertcm.totalconversions.com/Knowledge_Base/Document_Sound-Setup.shtml)
...and more.
Guest
12-23-2000, 12:58 AM
STOP!!!
Gawd, I didn't expect this to happen...this
NEVER happens on the board I'm used to
(dukeworld).
I'm a programmer. I've been working on
a particular design for a level I'm making
that requires portions of the level to be
rotated at specific ways. I've written code
that'll take a level and turn it X number of
degrees. Problem is, all of that code
applies to sectors and walls. Even though it
can move the sprites as the level is turned,
it can't rotate the sprites themselves.
So I came here asking if anybody knew the
numbers, because I'm not in the mood to
spend the next few days reading through
Ken Silverman's source code to find out for
myself.
Anyways, you're sure it's 5.6889? I figure
I'm gonna have a _lot_ of sprites to move
as this level progresses and I'd appreciate
BUILD perfect math (as in "if you pressed
"O" on this light switch sprite, it'd be
rotated to...") so I wouldn't have to go
through the level and manually fix
everything.
Anyways...Thanks for all the input. Much
better than Dukeworld's board.
------------------
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.