Hi All,
I have been evaluating using Java3D Immediate Mode vs Java-OpenGL Binding
(GL4Java).
I draw a 90000 sphere's randomly on the canvas using Java3D Immediate Mode
and using OpenGL. There is a drastic difference in the performance. Can
anyone tell me why is it so. The figures obtained are as follows:
OpenGL: 12s
Java3D: 38.91s
Note that to draw a sphere I used the utils sphere in Java3D and the GLU
sphere in OpenGL.
Following is the code used for Java3D:
m_gc3d.clear();
Vector3d vec = new Vector3d(1d, 1d, 1d);
Transform3D trans = new Transform3D();
for (int i = 0; i < 90000; i++)
{
vec.x = vec.x/Math.abs(vec.x)*Math.random()*-1d;
vec.y = vec.y/Math.abs(vec.y)*Math.random()*-1d;
vec.z = vec.z/Math.abs(vec.z)*Math.random()*-1d;
trans.setTranslation(vec);
m_gc3d.setModelTransform(trans);
m_gc3d.draw(m_geom);
}
swap();
Following is the code for OpenGL:
double fact = -1d;
for (int i = 0; i < Integer.parseInt(Test1.this.text.getText())*3; i++)
{
double x = Math.random()*fact/.001;
double y = Math.random()*fact/.001;
double z = Math.random()*fact/.001;
fact = fact*(-1d);
gl.glPushMatrix();
gl.glTranslated(x, y, 0d);
gl.glCallList(1);
gl.glPopMatrix();
}
Regards,
Ranjan George
ingenovis, A Division of iLabs Ltd.
Phone : 91-040-23352900/2 Ext.2006/2016
Fax : 91-040-23351522
Email : [EMAIL PROTECTED]
http://www.ingenovis.com
-----Original Message-----
From: Justin Couch [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 12:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Java 3D FAQ Weekly Posting (30 Dec 2002)
Simeon H.K. Fitch wrote:
> not the group's. My original itch was that I'm very interested when a
> new tip or other info tidbit is available, and would like to know when
> that happens. Since you pointed out the CVS access to the FAQ I'll just
> do it myself.
Ok, no probs. That was part of of the idea of trying to keep a
consistent header. If people get pissed off with seeing it once a week,
they can just killfile it pretty easily. In fact, Sun's listproc does
that too if you post the same subject twice in a given time, so I had to
do some trickery to allow the mail to get through :)
> That's a fair judgment call on your part. I'm in the camp that
> interprets the "frequent" part of FAQ very liberally, even to a
> speculative extreme:
I probably could do a little more that way, but I've never really gotten
around to it. I think a lot of people on this list just sort of assume
things like "it'll be done when it's given to us". One of these is
Pixel/Vertex shaders. There should probably be a speculative entry in
the FAQ about that (no J3D doesn't support them) but the question rarely
gets asked.
Just thinking about it, there's another reason too that sets this group
apart from your typical usenet-style group/listproc. There aren't that
many people trying to really stretch J3D in the way that you get for
OpenGL/D3D. I reckon I could count the "high end" users on two hands.
These folk are already comfortable with the capabilities and know where
to go to find answers. There are also two BoFs held each year and the
j3D team put out a set of outlines of Future Stuff there, which I
transcribe and then post here and also on the website. That seems to
cover most of those speculative questions too. So, going back to Pixel
Shaders, at a BoF a while ago, DougT put out a slide of Things coming in
1.4 which answered that question pretty much before anyone that cared
about it asked it.
> RTFF, etc.). I'm just publicly wondering if there is something with
> either the format or the process by which the FAQ is contributed to and
> communicated that could be improved to increase the inherent value of
> the FAQ.
I'm sure there is. If people asked more questions we could put more
stuff in :) I'm always open to suggestions and I usually try to jump to
answer a question with the FAQ entry before anyone else does if I can.
However, I do become rather unresponsive at times simply because of work
load. So you'll see my participation here yo-yos pretty heavily, and the
same thing with answering the aliases on the j3d.org site. (I only got
around to putting in all the site link requests and stuff for the last 2
months a couple of days ago and still haven't actually responded to any
of the emails yet).
> good tips/tricks could be better archived (which IMO is a valid use of
> the FAQ).
Well, depending on the length of the tip, I normally try to make more of
a tutorial out of it. That's what the Quick Fix section of j3d.org is
about. It's just stuff that looks useful being slurped off the list here
and formatted as a web page and off we go.
> I'd also point out that some people may spend more time answering new
> questions if the response had a good chance of ending up in the FAQ
Actually, I think a lot don't answer because they simply don't have a
clue about it. Again, comes down to volume of users. There's been a
constant undercurrent of people doing stereo work with J3D, for example,
and slow stream of questions about it. Unfortunately it has never lead
to a conclusive answer about the various paths to take, so it's just
ended up as one of those things that never gets a good FAQ entry even
though it probably should. Similar thing with the questions you see from
Davel Yazel at times. He's doing stuff at the bleeding edge of J3D which
nobody else has really tried before. He generally doesn't get answers
because nobody else (even the J3D team!) has any clue about what he's up
to.
> (JGO? Again, I may be from Pluto...)
Ah, my bad - JavaGaming.org
> <snip>
> I checked it out and noticed the mix of style and content. The
> <question>/<answer> delineation is the most important here...
Yeah, that's just my hack to make life easier for the generation.
Content is using a subset of XHTML, wrapping up in the large structural
style elements. Since I know the only time the content stuff is really
used is to generate the HTML pages, I felt that it was a sufficiently
non-dodgy hack just to dump the HTML markup directly into the document
itself. Saves me having to come up with a separate tagset to do it all
myself. Again, one of those things where I should probably have used
mixed-namespace content rather than the DTD/Entity hacking that I've
done. If you come up with something a little less hacked up, I'd love to
hear about it!
> area). I like having a TOC of all the questions up front, and also being
> able to easily search and browse all content.
That's true. It's also one of those long-standing requests that people
have had to put a search engine front-end onto the FAQ. Because of the
way I maintain it as the flat-file XML, it's never really leant itself
to the idea (although the XML-databases that are starting to become more
prevalent might work for that) and so I keep putting it off....
> it comes to including something in the FAQ. Would it be helpful if more
> people voiced their opinion when they see a question answered and think
> the exchange deserves to be included?
Let the rabble begin! :)
--
Justin Couch http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
- Greg Bear, Slant
-------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".