The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.java.programmer
From: Lasse Reichstein Nielsen <l...@hotpop.com>
Date: Thu, 02 Jun 2005 18:31:55 +0200
Local: Thurs 2 Jun 2005 17:31
Subject: Re: Optimise my ray tracer
Jon Harrop <use...@jdh30.plus.com> writes: I'll leave that for now (meaning: I haven't read the program yet :) > 1. What major optimisations are missing from my program (e.g. in C++, I pass > vectors by reference and try to inline vector operations). Generally, there are several tricks that allows the compiler and I'm sure Googleing for "java optimizing" will give about a gazillion > 2. Where is the floating-point machine epsilon in the Java libraries? I'm not sure what epsilon is to you, but you might want Double.MIN_VALUE, the smalles positive value representable as a double. > 3. How do you do infix operators in Java? You don't. The designers of Java decided early on that they wanted the *syntax* to always mean the same thing, making it easier to read other people's programs (in particular, they didn't want #define, and I guess overriding infix operators were ruled out for the same reason). > 4. Am I supposed to have a static main function which instantiates a class The static "main" function *does* start the program. You want to call > and invokes a member function of it in order to start the program? the "run" function from it, and since "run" is not static, you need to create an object before calling it. However, since "run" doesn't use that object, the "run" function could have been made static as well. Likewise the other methods on the class "ray" (classes are traditionally capitalized). Anyway, I might have time to look at it some more later :) > Here's my Java port: [snip] A link to an online file would take less room here :) /L You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||