Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / May 2004

Tip: Looking for answers? Try searching our database.

Simple Newbie Question? Is This kind of things possible with Java3D

Thread view: 
Goethals Frederik - 09 May 2004 17:28 GMT
Hi,

Firts of all, I hope that my English can be understood, I hope so...

I'm very new to Java3D and have been surfing a bit on the net after soms
examples of thing that are possible with Java3D
Now I would like to know if the following is possible.

I would like to know if I can - and how it could be done - to add two simple
beams (rectangles in 3D) to the screen. Can this be done with some simple
xyz-coordainates that I have to give? Because in my final application I
would have to build some model that exists out of multiple beams (not cubes
only, different width, height en depth). I could easyli have the coordinates
of those objects, but is this enough or do I have to knwo some about
clipping (or does Java do that automatically?).
Also, those independant objects could be next to each-other (in 3D). Give
this problems? The only example I have seen so far (that sounds like my
problem) is the colored cube. But my object would have only the frames, I
should be able to look through the objects (damn, don't know the word at the
time...)

So can this be done. Maybe some more experienced people can give me a litlle
bit of code where thera are 2 beams, so that I can see the result, and knwo
if it is possible or not. Ohterwise, I should look for some other
techniques... If the result is acceptable, then I would read a lot of books
of course...

thanks very much

Goethals Frederik
Andre Bialojahn - 09 May 2004 22:08 GMT
> Hi,
>
> I'm very new to Java3D and have been surfing a bit on the net
> after soms examples of thing that are possible with Java3D
> Now I would like to know if the following is possible.

Did you download and install J3D and the accompanying examples?
Have a look at them to get a first impression of what might be
possible with J3D and if it suits your needs.

> I would like to know if I can - and how it could be done - to add
> two simple beams (rectangles in 3D) to the screen. Can this be done
> with some simple xyz-coordainates that I have to give?

When you add an object to the -> content branch of the -> scenegraph,
you position it using absolute coordinates in 3-space.
After creation of a new -> Primitive it is centered around the origin
at (0/0/0). You will want to first rotate it to have it point in the
correct direction and afterwards translate it to the point where it
should finally reside.
The sequence of the transformations is important. It makes a diffe-
rence, if you first transpose and afterwards rotate something or turn
it the other way 'round. Keep that in mind when constructing your
scenes. The same holds for the ordering of rotations around the three
axes. RotX->RotY->RotZ might and in most cases will deliver something
different than RotY->RotX->RotZ, as well as all the other possible
combinations.

> Because in my final application I would have to build some model
> that exists out of multiple beams (not cubes only, different width,
> height en depth).

Sounds like an instance of Box() to me.
It's almost like a Cube, but you are able to specify the extents
along the three axes separately.

> I could easyli have the coordinates of those objects, but is this
> enough or do I have to knwo some about clipping (or does Java do
> that automatically?).

There's no need to clip but there might be a need for computing a
rotation, since the Primitive()s are aligned with the positive
y-axis (aka "standing upright").

> Also, those independant objects could be next to each-other (in 3D).
> Give this problems?

Not that I knew.
You can also wrap them together so that subsequent transformations
include *all* of your objects at once. That's where a scenegraph comes
in handy. It keeps track of the object's relations when being grouped
together.
F.e. if you built a frame from four long and thin boxes (top, right,
bottom and left) and combine those in one TransformGroup, you'll
be able to position and rotate the 'frame' as if being one single
object.

> The only example I have seen so far (that sounds like my problem)
> is the colored cube.

A *very* basic Primitive.
When you start your first explorations and steps using J3D *do not
forget* to add a light source to your scene and also to turn it on!
It might sound ridiculously trivial, but objects other than the
aforementioned ColorCube don't emit light by default and thus are
invisible. (Might save you some time spent on debugging your scene.)

> But my object would have only the frames, I should be able to look
> through the objects (damn, don't know the word at the time...)

It's "wireframing". J3D natively supports different kinds of
rendering. Wireframed is amongst them. :-)

> So can this be done.

As from what I understood you want to do: certainly, yes.

> Maybe some more experienced people can give me a litlle bit of
> code where thera are 2 beams, so that I can see the result, and
> knwo if it is possible or not.

Be assured: it is. I've just written a visualization using Cylinder()s
and home-brewn Frustra to represent the morphology of a neuron.
Some of these consist of several thousand primitives and just look
as being one structure.
I guess that is just what you want.

> Ohterwise, I should look for some other techniques...

Stick with J3D. It should be sufficient for what you want to do.

> If the result is acceptable, then I would read a lot of books
> of course...

Maybe, you'll want to have a look at the Java3D-Tutorial available
from inside Sun's Site, before heading for your local book store.
Use google for "j3d_tutorial_ch0.pdf" through "j3d_tutorial_ch7.pdf".
Most of the basic techniques are covered in this set of documents and
a more than just basic insight into J3Ds techniques is presented,
there.
If you are more advanced lateron, you'll also might want to join
"Java3D-interest" being run on one of sun's servers.

Enjoy,
André
Andre Bialojahn - 09 May 2004 22:21 GMT
> [Is J3D right for me?]

If it would have worked to mail you, you would have received some
example. But like this...

André
Goethals Frederik - 10 May 2004 17:01 GMT
> x-no-archive: yes
>
[quoted text clipped - 4 lines]
>
> Andr?

Hi,

I've just emailed you with my real e-mail adres.
Because of spam I transformed a little bit my adres

My adres is only "ivpv" AT "belgacom.net", withoout quotes en with the AT=@

Frederik

ps: the "_verwijder_mij"  means "remove me" but in Dutch


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.