This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > December 2004 > Re: Newbie - x3d (/VRML) and Java3d..... - example....
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 |
Re: Newbie - x3d (/VRML) and Java3d..... - example....
|
|
| bensmyth 2004-12-16, 12:17 pm |
| Here's an example of what I've done so far......
I've created a (static) pool table - completely in x3d (I could have done
the same in VRML).
I now want to add interaction.
Firstly I would like to add collision detection[1]. This obviously requires
scripting... For which I will opt for Java[2]... This is where the issues
arise! In my current world everything is static (ie I have created a model),
in order to handle collisions my script must know where all the balls are
positioned. Hence it makes sense to handle the positioning of balls within
the script rather than the x3d code.....
Collision detection would be far easier if I had created the balls within
Java3d!!!
Hence, my question, is it possible to create my world using Java (or in my
case Java3d), using x3d for the front end only??
Hope that helps clarify my problem......
Cheers,
Ben
[1] I'll develop this as a small prototype, before implementing in my
virtual world
[2] Javascript is just as suitable, but I'm more familiar with Java. In
fact, I may actually use Java3d.
| |
|
| if you focus on thinking of vrml (x3d) as a world description format,
then there is a point where, if a lot of your 3d is based in java then
that is your description and you don't need vrml.
but i've done something like this in VRML, where each ball controls its
own motion, and then routes its position to a hub that then routes on
to all the other balls, each ball then can tell where/when its been hit
and can respond accordingly.
simon.
| |
| bensmyth 2004-12-16, 7:18 pm |
| > but i've done something like this in VRML, where each ball controls its
> own motion, and then routes its position to a hub that then routes on
> to all the other balls, each ball then can tell where/when its been hit
> and can respond accordingly.
I think I have seen a similar example....
But it still seems more effort than writing in Java3d??
In Java3d I can define a BoundedSphere, I can then test for collisions (thus
enabling me to respond) using boundedSphere.intersect(boundedSphere2)....
On the other hand, if I were to define a Sphere in x3d (/VRML) I would need
to define my own intersect method....
This seems like far more work?
One potential problem I can see is - defining a PlaneSensor (for example) in
my world...
Ben
(Sorry if this doesn't make complete sense - I'm not too sure on how this
all works; yet...)
| |
|
| ummm,
> In Java3d I can define a BoundedSphere, I can then test for
collisions (thus
> enabling me to respond) using
boundedSphere.intersect(boundedSphere2)....
i think with your project it might be save to go to a specific solution
for two spheres of the same diameter, in other words check to see if
the two balls are nearer than a ball diameter. ;-^
could even reduce it to the 2D plane of the table.
simon.
| |
| bensmyth 2004-12-18, 7:16 pm |
| > but i've done something like this in VRML, where each ball controls its
> own motion, and then routes its position to a hub that then routes on
> to all the other balls, each ball then can tell where/when its been hit
> and can respond accordingly.
I think I have seen a similar example....
But it still seems more effort than writing in Java3d??
In Java3d I can define a BoundedSphere, I can then test for collisions (thus
enabling me to respond) using boundedSphere.intersect(boundedSphere2)....
On the other hand, if I were to define a Sphere in x3d (/VRML) I would need
to define my own intersect method....
This seems like far more work?
One potential problem I can see is - defining a PlaneSensor (for example) in
my world...
Ben
(Sorry if this doesn't make complete sense - I'm not too sure on how this
all works; yet...)
| |
|
| if you focus on thinking of vrml (x3d) as a world description format,
then there is a point where, if a lot of your 3d is based in java then
that is your description and you don't need vrml.
but i've done something like this in VRML, where each ball controls its
own motion, and then routes its position to a hub that then routes on
to all the other balls, each ball then can tell where/when its been hit
and can respond accordingly.
simon.
| |
| bensmyth 2004-12-20, 12:21 pm |
| Here's an example of what I've done so far......
I've created a (static) pool table - completely in x3d (I could have done
the same in VRML).
I now want to add interaction.
Firstly I would like to add collision detection[1]. This obviously requires
scripting... For which I will opt for Java[2]... This is where the issues
arise! In my current world everything is static (ie I have created a model),
in order to handle collisions my script must know where all the balls are
positioned. Hence it makes sense to handle the positioning of balls within
the script rather than the x3d code.....
Collision detection would be far easier if I had created the balls within
Java3d!!!
Hence, my question, is it possible to create my world using Java (or in my
case Java3d), using x3d for the front end only??
Hope that helps clarify my problem......
Cheers,
Ben
[1] I'll develop this as a small prototype, before implementing in my
virtual world
[2] Javascript is just as suitable, but I'm more familiar with Java. In
fact, I may actually use Java3d.
| |
| bensmyth 2004-12-21, 4:15 am |
| > but i've done something like this in VRML, where each ball controls its
> own motion, and then routes its position to a hub that then routes on
> to all the other balls, each ball then can tell where/when its been hit
> and can respond accordingly.
I think I have seen a similar example....
But it still seems more effort than writing in Java3d??
In Java3d I can define a BoundedSphere, I can then test for collisions (thus
enabling me to respond) using boundedSphere.intersect(boundedSphere2)....
On the other hand, if I were to define a Sphere in x3d (/VRML) I would need
to define my own intersect method....
This seems like far more work?
One potential problem I can see is - defining a PlaneSensor (for example) in
my world...
Ben
(Sorry if this doesn't make complete sense - I'm not too sure on how this
all works; yet...)
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|