For Programmers: Free Programming Magazines  


Home > Archive > Java Help > December 2004 > java3d question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author java3d question
Saso Zagoranski

2004-12-23, 9:04 am

I apologize if this is not the correct group to ask this question but
comp.lang.java.3d seems to be very unactive...

Here is my java3d question:
I would like to know how to change simple object properties.
E.g.:
I have a geometry.Box object. During the execution of the program (by that I
mean that the object is already live and compiled) I would like to change
two properties of this box:
- color
- size

how can I do that?

thanks,
Saso Zagoranski


ByteCoder

2004-12-23, 9:04 am

Saso Zagoranski wrote:
> I apologize if this is not the correct group to ask this question but
> comp.lang.java.3d seems to be very unactive...
>
> Here is my java3d question:
> I would like to know how to change simple object properties.
> E.g.:
> I have a geometry.Box object. During the execution of the program (by that I
> mean that the object is already live and compiled) I would like to change
> two properties of this box:
> - color
> - size
>
> how can I do that?
>
> thanks,
> Saso Zagoranski


I don't know much about Java3D, but wouldn't it work just like any other
method call?

--
-------------
- ByteCoder - ...I see stupid people
-------------
Curiosity *Skilled* the cat
Saso Zagoranski

2004-12-23, 9:04 am

Sure :)
But you need to know which methods to call...

Java3D has a pretty complicated way of defining shape and appearance.
You don't have Box.setSize(...) or Box.setColor(...) methods...
(unfortunately :( ).

saso

"ByteCoder" <ByteCoder@127.0.0.1> wrote in message
news:32vombF3rr7l4U1@individual.net...
> Saso Zagoranski wrote:
>
> I don't know much about Java3D, but wouldn't it work just like any other
> method call?
>
> --
> -------------
> - ByteCoder - ...I see stupid people
> -------------
> Curiosity *Skilled* the cat



ByteCoder

2004-12-23, 9:04 am

Saso Zagoranski wrote:
> Sure :)
> But you need to know which methods to call...
>
> Java3D has a pretty complicated way of defining shape and appearance.
> You don't have Box.setSize(...) or Box.setColor(...) methods...
> (unfortunately :( ).
>
> saso


Well, you can find a *lot* of information about Java3D programming on
the Internet. Too bad for you I just cleaned my bookmarks (and removed
my Java3D section...)

Google this:
tutorial Java3D
First result:
<developer.java.sun.com/developer/onlineTraining/java3d/>

--
-------------
- ByteCoder - ...I see stupid people
-------------
Curiosity *Skilled* the cat
Saso Zagoranski

2004-12-23, 4:08 pm

Thanks for the answer but I was hoping for a direct answer...
I did download and print out almost the entire tutorial published by sun and
couldn't
find that very simple information. It's true that I quickly looked at some
of the chapters because they
didn't seem to have what I needed and it is possible that it actually was
there and I didn't see it.

So... quick and direct answer anyone? :)

saso

"ByteCoder" <ByteCoder@127.0.0.1> wrote in message
news:32vt02F3sbovsU1@individual.net...
> Saso Zagoranski wrote:
>
> Well, you can find a *lot* of information about Java3D programming on the
> Internet. Too bad for you I just cleaned my bookmarks (and removed my
> Java3D section...)
>
> Google this:
> tutorial Java3D
> First result:
> <developer.java.sun.com/developer/onlineTraining/java3d/>
>
> --
> -------------
> - ByteCoder - ...I see stupid people
> -------------
> Curiosity *Skilled* the cat



ByteCoder

2004-12-23, 4:08 pm

Saso Zagoranski wrote:
> Thanks for the answer but I was hoping for a direct answer...
> I did download and print out almost the entire tutorial published by sun and
> couldn't
> find that very simple information. It's true that I quickly looked at some
> of the chapters because they
> didn't seem to have what I needed and it is possible that it actually was
> there and I didn't see it.
>
> So... quick and direct answer anyone? :)


Sorry, no direct awnser, but this got me interested again. :)

--
-------------
- ByteCoder - ...I see stupid people
-------------
Curiosity *Skilled* the cat
Saso Zagoranski

2004-12-23, 4:08 pm

I found out that you actually can't resize a geometry.Box :(
Neither can you resize any of the other primitives, such as:
Cone, Sphere, ...

I personally think that this sucks!
And to be honest... I'm not all that excited about java3d too. I've been
using
it for a few ws and I think that it's design is very bad... but that's
just me.

saso

"ByteCoder" <ByteCoder@127.0.0.1> wrote in message
news:3300vpF3pf12nU1@individual.net...
> Saso Zagoranski wrote:
>
> Sorry, no direct awnser, but this got me interested again. :)
>
> --
> -------------
> - ByteCoder - ...I see stupid people
> -------------
> Curiosity *Skilled* the cat



Ulf Nordlund

2004-12-23, 9:04 pm

Saso Zagoranski skrev:
> Thanks for the answer but I was hoping for a direct answer...
> I did download and print out almost the entire tutorial published by sun and
> couldn't
> find that very simple information. It's true that I quickly looked at some
> of the chapters because they
> didn't seem to have what I needed and it is possible that it actually was
> there and I didn't see it.
>
> So... quick and direct answer anyone? :)
>
> saso
>
> "ByteCoder" <ByteCoder@127.0.0.1> wrote in message
> news:32vt02F3sbovsU1@individual.net...
>
>
>
>


Saso, I update my 3D-stuff in a separate method, like so (it's for a
surface, not a box, but anyway..):

public void updateGeometry() {

// ...set new values for surfCoordBase and surfColorBase here...
surfaceQuadArray.setCoordinates(0, surfCoordBase);
surfaceQuadArray.setColors(0, surfColorBase);
}

Not sure how Java3D does the updating though, "behind the curtain" so to
speak (and there's been a couple of years since I wrote it)...
Cheers,
/ulf
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com