• Advertisement

Archived

This topic is now archived and is closed to further replies.

math question

This topic is 5101 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In game programming would you ever need to use calculus much? Also I have to learn java for my first year university course. Can you only do object oriented in java? The course is very easy for me since i''ve been programming in c++ for about 4-5 years. But it''s going to be even easier next year when we do c++.

Share this post


Link to post
Share on other sites
Advertisement
I believe most people use the Euclidean method (I think that''s what it''s called) rather than proper calculus. That is, you assume your time/distance/whatever increments are small enough such that everything is linear. Sort of making a "good" approximation to a proper integral or derivative (think of how you got from Reimann sums to integrals, or how you view dt, dx, and friends in physics) That''s what I do, anyway.

Share this post


Link to post
Share on other sites
Yes, Java is purely object-oriented (if you leave out fundamental types for a second), and the university course shouldn''t be any problem if you know C++.

On java.sun.com you''ll find a Java tutorial if you''re interested in jumping right in!

cya,
Drag0n

-----------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning..." -- Rich Cook

Share this post


Link to post
Share on other sites
Euler integration is what that is.

Anyway, looking back, no I don''t really use anything directly learned from intro calc. But you need calc as a framework to learn the higher maths.

The subject you would definitely need is vector algebra/vector calculus.

But another thing to think about- software companys like to hire the really smart people to be programmers, smart people have no problem taking courses that are not immediately useful (like calc). So if you want to be able to compete with these overacheiving smart people, you''re going to have to take the courses that are not immediately useful.

Share this post


Link to post
Share on other sites
I''m taking a math class that does matrices, vectors, logic and stuff. Next year i''m going to be taking the more advanced class that has the same sort of stuff.
Jave being purely object oriented is a bit limiting. Some thing are better to do non object oriented.
Can you use opengl with java?
Also how do you open a window in java on unix.

Share this post


Link to post
Share on other sites
quote:
Original post by pinacolada
Euler integration is what that is.



I feel stupid now. Thanks (Recently covered Euclidean algorithm in Abstract Algebra, recently used Euler integration in Experimental Physics)

Share this post


Link to post
Share on other sites
You don''t have to do OO in Java any more than you have to avoid it in C. Seriously, it''s a nice language to be working with because it does OO-type stuff by default that you have to *ask* for in C++ (which I find counterintuitive, but that''s probably because they tried to sell it as an OO language when I was learning it).

Calculus doesn''t directly come up in most programming, but as a programmer you''ll still be very glad you learned it, eventually, somehow. Trust me.

I am pretty sure OpenGL bindings exist for Java (hell, they probably exist for Python too) but I wouldn''t know where to point you. STFW.

Opening a window requires that you use some kind of API, the same way as it would in C++. For Java, you''ll want to be looking at Swing, which is the successor to AWT. This stuff is designed for system-independance, but they can''t do everything... :/ Anyway. You might also need to start up your classes with ''javaw'' instead of plain ''java''.

Share this post


Link to post
Share on other sites
Doing anything else than the simplest program without object orientation in Java isn''t feasible, since the library is object oriented - ie you would get a headache when the library demands an object from you to implement an interface if you''re not working in an object oriented way.
However, it sometimes pays not to enforce the "rules" of object orientation so strictly, especially when programming games. For example some objects are just begging to be treated as structs (Like Point).

***
For Java games and Java related resources, go to http://www.javaengines.dk
***

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I work as a PS2 programmer at a leading game company. Surprisingly, I cracked open my calculus book last week. I needed to get the derivative of an analytic function in order to compute surface normals.

But more to the point, mastering the fundamentals of math and physics (e.g., calculus, ODEs/PDEs, mechanics, E&M, etc.) now will pay off for the rest of your life -- long after Java is retired to the Old Languages Home with COBOL and Fortran. You won''t get much of a chance after university, so seize the opportunity to learn what you can now.

Share this post


Link to post
Share on other sites
Gaaah!! I've got my calculus exam tomorrow

Anyway, I'm quite happy I've taken that course and I think the knowledge will come in handy although there is a possibility that I won't ever have to use some actual calculus.

As for your question about java (I've got the exam on that course as well ), Yes, you can write java in a procedural way if that was your question (by abusing the "static" keyword).

Yes, there exists OpenGL bindings for Java.

And to open a window you do (something like) this:

import javax.swing.*;

public MyClass inherits JFrame {
myClass() {
setSize( 100, 100 );
setDefaultCloseOperation( EXIT_ON_CLOSE );
show();
}

public static main() {
new MyClass();
}
}

// Edit: fixed error in code

-Luctus

Statisticly seen, most things happens to other people.
[Mail]


[edited by - Luctus on March 5, 2004 4:37:31 PM]

Share this post


Link to post
Share on other sites
How much calculus do you recon i need. I already know quite a bit from highschool such as derivitives, intergrating stuff like that.

Share this post


Link to post
Share on other sites
quote:
Original post by hello_there
How much calculus do you recon i need. I already know quite a bit from highschool such as derivitives, intergrating stuff like that.


You need to know enough to be able to learn whatever you need to know.

[edited by - psamty10 on March 5, 2004 8:10:57 PM]

Share this post


Link to post
Share on other sites
Being able to minimize or maximize a function has come up a few times for me already, but honestly, calculus is probably best suited to situations where you can''t bend the rules of physics .

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites

  • Advertisement