Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  how can we abtain sin and cos methods ?  (Read 1708 times)
0 Members and 1 Guest are viewing this topic.
Offline blackjava

Senior Newbie




flashing vampire


« Posted 2005-01-25 23:24:27 »

howdy~

i'm developing a game based on J2ME which needs sin, cos and tag values but i found no such methods in J2ME, is there any way to do that then ?

Never end on learning~
Offline Serethos

Junior Member




Java games rock!


« Reply #1 - Posted 2005-01-26 05:43:15 »

if you are programming with cldc1.0 you're lost. the only workaround is to use hard coded constants like in good ole'
days. i know thats not a big deal but for my experience you need real sin/cos methods in j2me very(!) rarely if you are not programming 3D games.
Offline mhale

Senior Newbie




Take pity, I'm just a poor blob!


« Reply #2 - Posted 2005-01-27 00:45:35 »

You can also use sin/cos routines for fixed-point numbers. If you google you will probably find some open source J2ME class with them in.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline wooD

Senior Newbie




J2ME Developer


« Reply #3 - Posted 2005-01-27 14:39:10 »

I looked into this when I started my last game. It was a 2d, so I'm not sure what your requirements are?  I ended up doing some odd contortions to make my collision detection logic happen. ShiftFP2D was very handy to do what I needed, but no sign/cos or sqrt.

For distances I ended up keeping all my measurements squared and measuring against values that were also squared. It worked for me.

For cases where I needed to know direction, I ended up using unit vectors and in some cases dot products to calculate facing values. Like I said, not pretty, but it did work.

If you can use cldc 2.0, that would also solve the problems.

Wood

Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #4 - Posted 2005-01-27 15:14:39 »

Quote

If you can use cldc 1.1, that would also solve the problems.



Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline blackjava

Senior Newbie




flashing vampire


« Reply #5 - Posted 2005-02-01 23:32:39 »

if im with cldc1.1 then how could i achieve exactly sin, cos and tag values ?

regards~

Never end on learning~
Offline calzada

Junior Member




m3g is the truth


« Reply #6 - Posted 2005-02-02 08:21:53 »

you'r enot lost, you can use:
Float midp Point

http://henson.newmail.ru/j2me/Float.htm


for:
double asin(double x)
double acos(double x)
double atan(double x)
double atan2(double y, double x)
double exp(double x)
double log(double x)
double log10(double x)
double pow(double x, double y)
go to:
http://henson.newmail.ru/j2me/Float11.htm

regards,
Franck

Mobile Entertainment Studio: M-E-S
http://sourceforge.net/projects/cazapool3d/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!