Newsgroups: comp.lang.java.programmer
From: Lasse Reichstein Nielsen <l...@hotpop.com>
Date: Fri, 03 Jun 2005 08:53:09 +0200
Local: Fri 3 Jun 2005 07:53
Subject: Re: Optimise my ray tracer
Jon Harrop <use...@jdh30.plus.com> writes: You create a *lot* of vector objects. That means that you should make > 1. What major optimisations are missing from my program (e.g. in C++, I pass > vectors by reference and try to inline vector operations). creation as fast as possible. That includes having as few fields as possible on the object. All your nested classes are non-static. That means that they all have Make all your nested classes static. I'm certain that will give Fiddling with the code, I see that you only ever use scaling in > Here's my Java port: Here's a modification of it, that is (IMHO) a little prettier and more Java-like. For a real Java program, I wouldn't have all those classes as nested classes at all, they would be in separate files. <URL:http://www.infimum.dk/privat/RayTracing.java> Generally, I made everything static that could be made static, and I tried not to change the actual algorithm at all. Hope it works :) 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.
| ||||||||||||||