math question

Started by
11 comments, last by hello_there 20 years, 1 month ago
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++.
____________________________________________________________How could hell be worse?
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.
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
-----------------------------"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"...nobody ever accused English pronounciation and spelling of being logical." -- Bjarne Stroustrup"...the war on terror is going badly because, if you where to compare it to WWII, it's like America being attacked by Japan, and responding by invading Brazil." -- Michalson
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.
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.
____________________________________________________________How could hell be worse?
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)

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''.
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
***

Developer journal: Multiplayer RPG dev diary

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.
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]
-LuctusIn the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams

This topic is closed to new replies.

Advertisement