To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 16839
Subject: 
Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 01:47:00 GMT
Highlighted: 
(details)
Viewed: 
11719 times
  
Well, in the interests of sharing, as this community does so well, here's the
basics of a simple LDraw viewer that I wrote in the Processing language about a
year and a half ago. It is by no means complete, but it will display small
models (if you edit the source to load the model, right near the beginning of
the main code... no way to pick from a listing)  Processing is so friendly that
I was able to build this basic viewer in just a week or two, then life jumped in
and took over all my time again, as usual.

There's a good chance that I tapped some people on here or on the Processing.org
forums to help with the math ack when I was working on it, so, sorry if I forget
to mention, but it's been a long time since I worked on this...

Here's the link to a little blurb about what I had written so long ago, with 2
sample images:
http://www.randommeme.com/mblog/post.cfm/ldraw-viewer-in-processing

And here's the link to the post with the download file:
http://www.randommeme.com/mblog/post.cfm/simple-ldraw-viewer-code-in-processing

About the Processing Language:
Processing runs in Java, and uses the same syntax, but (for me) it makes working
with graphics a breeze!
http://processing.org/
From the website:
Processing is an open source programming language and environment for people who
want to program images, animation, and interactions. It is used by students,
artists, designers, researchers, and hobbyists for learning, prototyping, and
production. It is created to teach fundamentals of computer programming within a
visual context and to serve as a software sketchbook and professional production
tool.

Enjoy.
-Andy Lynch


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 06:32:47 GMT
Viewed: 
11960 times
  
In lugnet.cad, Andy Lynch wrote:
Well, in the interests of sharing, as this community does so well, here's the
basics of a simple LDraw viewer that I wrote in the Processing language about a
year and a half ago. It is by no means complete, but it will display small
models (if you edit the source to load the model, right near the beginning of
the main code... no way to pick from a listing)  Processing is so friendly that
I was able to build this basic viewer in just a week or two, then life jumped in
and took over all my time again, as usual.

The neat thing about Processing is that since it is based on Java it is possible
to export Processing programs (excluding some functions) as cross-platform
applets that can be embedded in web pages.

So, what Andy has created is the basis for an online LDraw viewer! One possible
application of this is to allow people without LDraw installations to
nevertheless view models in 3d using their browsers. To illustrate the
feasibility of this I made a quick hack online version of the code that displays
a fully-inlined model (so no part library is required):

http://anoved.net/files/alvlite-test/

I look forward to seeing how this progresses.

Jim


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 07:05:52 GMT
Viewed: 
11938 times
  
In lugnet.cad, Andy Lynch wrote:
Well, in the interests of sharing, as this community does so well, here's the
basics of a simple LDraw viewer that I wrote in the Processing language about a
year and a half ago. It is by no means complete, but it will display small
models (if you edit the source to load the model, right near the beginning of
the main code... no way to pick from a listing)  Processing is so friendly that
I was able to build this basic viewer in just a week or two, then life jumped in
and took over all my time again, as usual.

There's a good chance that I tapped some people on here or on the Processing.org
forums to help with the math ack when I was working on it, so, sorry if I forget
to mention, but it's been a long time since I worked on this...

Here's the link to a little blurb about what I had written so long ago, with 2
sample images:
http://www.randommeme.com/mblog/post.cfm/ldraw-viewer-in-processing

And here's the link to the post with the download file:
http://www.randommeme.com/mblog/post.cfm/simple-ldraw-viewer-code-in-processing

About the Processing Language:
Processing runs in Java, and uses the same syntax, but (for me) it makes working
with graphics a breeze!
http://processing.org/
From the website:
Processing is an open source programming language and environment for people who
want to program images, animation, and interactions. It is used by students,
artists, designers, researchers, and hobbyists for learning, prototyping, and
production. It is created to teach fundamentals of computer programming within a
visual context and to serve as a software sketchbook and professional production
tool.

Enjoy.
-Andy Lynch

That looks very good.

I have also made an attempt to build a viewer, but it is also very limited in
what it can do (very little files if you do not wait an hour, no optional lines,
but it could read subfiles).
As I discovered that it is quite easy to write a viewer for some lines, but
much, much for effort to have a quick working LDraw viewer I left that project
and asked for a DLL from the current working LDraw viewer that I can use in my
apps.

So at present I am still searching for such a .NET DLL for a viewer that can be
used on all OS without to be recompiled.

cu
mikeheide


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 07:14:00 GMT
Viewed: 
11993 times
  
In lugnet.cad, Jim DeVona wrote:
In lugnet.cad, Andy Lynch wrote:
Well, in the interests of sharing, as this community does so well, here's the
basics of a simple LDraw viewer that I wrote in the Processing language about a
year and a half ago. It is by no means complete, but it will display small
models (if you edit the source to load the model, right near the beginning of
the main code... no way to pick from a listing)  Processing is so friendly that
I was able to build this basic viewer in just a week or two, then life jumped in
and took over all my time again, as usual.

The neat thing about Processing is that since it is based on Java it is possible
to export Processing programs (excluding some functions) as cross-platform
applets that can be embedded in web pages.

So, what Andy has created is the basis for an online LDraw viewer! One possible
application of this is to allow people without LDraw installations to
nevertheless view models in 3d using their browsers. To illustrate the
feasibility of this I made a quick hack online version of the code that displays
a fully-inlined model (so no part library is required):

http://anoved.net/files/alvlite-test/

I look forward to seeing how this progresses.

Jim

Here it looks very promising.
But what will be the loading time if I have larger models?

I would be very interested in this kind of app as it will make things much more
easy to display models to the webside visitor (see my "personal OMR" at
http://mikeheide.kilu.de).
No more create pictures and put them in the webpage. Only this tiny little
thing.

cu
mikeheide


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 11:12:33 GMT
Viewed: 
12117 times
  
In lugnet.cad, Michael Heidemann wrote:
I have also made an attempt to build a viewer, but it is also very limited in
what it can do (very little files if you do not wait an hour, no optional lines,
but it could read subfiles).
As I discovered that it is quite easy to write a viewer for some lines, but
much, much for effort to have a quick working LDraw viewer I left that project
and asked for a DLL from the current working LDraw viewer that I can use in my
apps.

So at present I am still searching for such a .NET DLL for a viewer that can be
used on all OS without to be recompiled.

cu
mikeheide
I tried to write a viewer once too (as a series of experimentation of maybe
having done a CAD program for parts authors!) using Tcl and OpenGL, but it
turned out to be *REALLY* slow, most probably due to bad subfile handling. While
the Animal Frog piece was not *so* bad, 3002.dat was incredibly slow and the PF
M-Motor threw an overflow error. So much for that. :)

Akin to Mike's hopes, an LDraw viewer library for tcl3d (=OpenGL bindings for
Tcl) would indeed work for me...

-Santeri


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 13:16:13 GMT
Viewed: 
12133 times
  
In lugnet.cad, Santeri Piippo wrote:
In lugnet.cad, Michael Heidemann wrote:
I have also made an attempt to build a viewer, but it is also very limited in
what it can do (very little files if you do not wait an hour, no optional lines,
but it could read subfiles).
As I discovered that it is quite easy to write a viewer for some lines, but
much, much for effort to have a quick working LDraw viewer I left that project
and asked for a DLL from the current working LDraw viewer that I can use in my
apps.

So at present I am still searching for such a .NET DLL for a viewer that can be
used on all OS without to be recompiled.

cu
mikeheide
I tried to write a viewer once too (as a series of experimentation of maybe
having done a CAD program for parts authors!) using Tcl and OpenGL, but it
turned out to be *REALLY* slow, most probably due to bad subfile handling. While
the Animal Frog piece was not *so* bad, 3002.dat was incredibly slow and the PF
M-Motor threw an overflow error. So much for that. :)

Akin to Mike's hopes, an LDraw viewer library for tcl3d (=OpenGL bindings for
Tcl) would indeed work for me...

Incidentally, Processing does have an OpenGL renderer (JOGL), although I haven't
done any sort of testing to see how significant the performance benefit is. I
used the software renderer for the web viewer I posted just because the support
files for OpenGL increased the applet site to a few MB and I did not want to
wait for it to upload.

But, I am a fan of Tcl, too, so a tcl3d library would please me as well.

Jim


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Tue, 12 Jan 2010 13:22:22 GMT
Viewed: 
12146 times
  
In lugnet.cad, Michael Heidemann wrote:
In lugnet.cad, Jim DeVona wrote:

I look forward to seeing how this progresses.

Jim

Here it looks very promising.
But what will be the loading time if I have larger models?

That is the key question. I have not tried a larger model yet (it takes some
preparation first to inline the model). I think I first may try to address the
question of how to efficiently enable part library access for the embedded
viewer.

I would be very interested in this kind of app as it will make things much more
easy to display models to the webside visitor (see my "personal OMR" at
http://mikeheide.kilu.de).
No more create pictures and put them in the webpage. Only this tiny little
thing.

I agree - the idea of an online gallery is partly what motivated me to try this.

Jim


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Wed, 13 Jan 2010 11:10:22 GMT
Viewed: 
12817 times
  
In lugnet.cad, Jim DeVona wrote:
In lugnet.cad, Andy Lynch wrote:
The neat thing about Processing is that since it is based on Java it is possible
to export Processing programs (excluding some functions) as cross-platform
applets that can be embedded in web pages.

So, what Andy has created is the basis for an online LDraw viewer! One possible
application of this is to allow people without LDraw installations to
nevertheless view models in 3d using their browsers. To illustrate the
feasibility of this I made a quick hack online version of the code that displays
a fully-inlined model (so no part library is required):

http://anoved.net/files/alvlite-test/

Very nice. I only took a look in IE and on a Windows XP PC and required me to
download and upgrade the Java plugin.
Will one be able to display this in another browser Chrome or on another
platform like MacOS?

I look forward to seeing how this progresses.

Me too.
This looks very exciting!

Jaco


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Wed, 13 Jan 2010 14:48:55 GMT
Viewed: 
12828 times
  
In lugnet.cad, Jaco van der Molen wrote:
In lugnet.cad, Jim DeVona wrote:
In lugnet.cad, Andy Lynch wrote:
The neat thing about Processing is that since it is based on Java it is possible
to export Processing programs (excluding some functions) as cross-platform
applets that can be embedded in web pages.

So, what Andy has created is the basis for an online LDraw viewer! One possible
application of this is to allow people without LDraw installations to
nevertheless view models in 3d using their browsers. To illustrate the
feasibility of this I made a quick hack online version of the code that displays
a fully-inlined model (so no part library is required):

http://anoved.net/files/alvlite-test/

Very nice. I only took a look in IE and on a Windows XP PC and required me to
download and upgrade the Java plugin.
Will one be able to display this in another browser Chrome or on another
platform like MacOS?

Yep, I tested it in Safari and Firefox on my Mac and in Firefox on XP before
posting it. I already had Java in both cases, but if I understand correctly it
does prompt you to download the plugin if you need it, right?

Jim


Subject: 
Re: Simple LDraw viewer code for Processing.org
Newsgroups: 
lugnet.cad
Date: 
Wed, 13 Jan 2010 16:19:02 GMT
Viewed: 
13352 times
  
In lugnet.cad, Jim DeVona wrote:
In lugnet.cad, Jaco van der Molen wrote:
In lugnet.cad, Jim DeVona wrote:
In lugnet.cad, Andy Lynch wrote:
The neat thing about Processing is that since it is based on Java it is possible
to export Processing programs (excluding some functions) as cross-platform
applets that can be embedded in web pages.

So, what Andy has created is the basis for an online LDraw viewer! One possible
application of this is to allow people without LDraw installations to
nevertheless view models in 3d using their browsers. To illustrate the
feasibility of this I made a quick hack online version of the code that displays
a fully-inlined model (so no part library is required):

http://anoved.net/files/alvlite-test/

Very nice. I only took a look in IE and on a Windows XP PC and required me to
download and upgrade the Java plugin.
Will one be able to display this in another browser Chrome or on another
platform like MacOS?

Yep, I tested it in Safari and Firefox on my Mac and in Firefox on XP before
posting it. I already had Java in both cases, but if I understand correctly it
does prompt you to download the plugin if you need it, right?

Jim

On my XP with already installed (and current) Java I did not have to download
anything more.

cu
mikeheide


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR