| Author |
picking of vertices (coords) with vrml ?
|
|
| Robert Ludewig 2004-09-15, 7:18 pm |
| Hello
is there any way I can do picking with vrml the following way:
I want to send out a ray into the space from an arbitary point into an
arbitary direction.
In case that ray hits a IndexedFaceSet I want to get the vertices (coords)
that belong to the face (polygon) that was hit by the ray and then modify
the position of those vertices (coords).
Can something like that be done with vrml.
I need it for a welding and drilling robot that shall be simulated in vrml.
That robot can cut/grind the workpiece or weld some new material on the
workpice. So where ever the robot arm goes the workpiece changes its
shape...
| |
| Joerg Scheurich aka MUFTI 2004-09-15, 7:18 pm |
| > is there any way I can do picking with vrml the following way:
> I want to send out a ray into the space from an arbitary point into an
> arbitary direction.
You need to read the entire scenegraph and then have to continue with
3D mathematics in a scriptnode (preferable java for speed reasons) 8-(
For the cortona browser there is a extension to do this easier/faster.
http://www.parallelgraphics.com/pro...beta/collision/
> I need it for a welding and drilling robot that shall be simulated in vrml.
> That robot can cut/grind the workpiece or weld some new material on the
> workpice. So where ever the robot arm goes the workpiece changes its
> shape...
This is a typical object-object collision question.
VRML/X3D by itself is standard about visualisation, not about simple
physics simulation (yet).
so long
MUFTI
--
Wir haben die Welt gesucht, um allen Arbeitsflaeche-Verlag Beduerfnisse
zu treffen.
(aus einem Softwarehandbuch, Stichwort: desktop-publishing)
| |
| Paul Aslin 2004-09-15, 7:18 pm |
|
Blaxxun/BS Contact also has and extension
Browser.computeRayHit(here,there);
where here and there are SFVec3f values
The function returns a SFNode which contains various bits of
information using a custom node.
Best to refer to company documentation on this.
On Wed, 15 Sep 2004 17:28:21 +0200, "Robert Ludewig"
<schwertfischtrombose@gmx.de> wrote:
>Hello
>
>is there any way I can do picking with vrml the following way:
>I want to send out a ray into the space from an arbitary point into an
>arbitary direction.
>In case that ray hits a IndexedFaceSet I want to get the vertices (coords)
>that belong to the face (polygon) that was hit by the ray and then modify
>the position of those vertices (coords).
>Can something like that be done with vrml.
>I need it for a welding and drilling robot that shall be simulated in vrml.
>That robot can cut/grind the workpiece or weld some new material on the
>workpice. So where ever the robot arm goes the workpiece changes its
>shape...
>
>
| |
| Robert Ludewig 2004-09-15, 7:18 pm |
|
The Browser I am using does not support java (only javascript/vrmlscript)
its called XROOMS and uses 90% of the source code of balxxuns contact.
It is not possible touse extensions with that viewer.
> You need to read the entire scenegraph and then have to continue with
> 3D mathematics in a scriptnode (preferable java for speed reasons) 8-(
Ermm lets say all there is in the scene is one IFS. Can you describe in
pseudeocde how the procedure for that woul dlook like ?
I certainly can calculate that ray by point and directionvector. But how do
I find out if that ray hit the IFS somewhere ?
And also how do I find out what polygon was hit ?
| |
| Joerg Scheurich aka MUFTI 2004-09-16, 10:27 am |
| Robert Ludewig <schwertfischtrombose@gmx.de> wrote:
> The Browser I am using does not support java (only javascript/vrmlscript)
> its called XROOMS and uses 90% of the source code of balxxuns contact.
> It is not possible touse extensions with that viewer.
If you have the source code, you can think about building the script
in c++ by replacing the "COM" code in src/vrml/src/gvscript.cpp with
something more usefull 8-(
[color=darkred]
> Ermm lets say all there is in the scene is one IFS. Can you describe in
> pseudeocde how the procedure for that woul dlook like ?
A example to print out the edges of the polygons of a IndexedFaceSet:
#VRML V2.0 utf8
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry DEF IndexedFaceSet1 IndexedFaceSet
{
coord Coordinate
{
point
[
0 0.999998 0
0 0.999998 0
0 0.999998 0
0 0.999998 0
0 -0.874998 -0.937498
0.817744 -0.875000 0.458476
-0.817744 -0.875000 0.458476
1.396983e-7 -0.874998 -0.937500
0 -0.999998 0
0 -0.999998 0
0 -0.999998 0
0 -0.999998 0
]
}
coordIndex
[
0 5 4 -1
1 6 5 -1
2 7 6 -1
4 5 9 -1
5 6 10 -1
6 7 11 -1
]
}
}
]
}
DEF ProximitySensor1 ProximitySensor
{
size 1e4 1e4 1e4
}
DEF Script1 Script
{
eventIn SFRotation rotation1_in
eventIn SFVec3f vec3f1_in
directOutput TRUE
mustEvaluate TRUE
field SFNode ifs USE IndexedFaceSet1
field SFVec3f pos 0 0 0
field SFRotation rot 0 0 1 0
url
[
"java script:
// field SFVec3f pos //
// field SFRotation rot //
// field SFNode ifs //
function print_polygons()
{
print('begin polygon list');
for (i = 0; i < ifs.coordIndex.length; i++)
{
index = ifs.coordIndex[i];
if (index != -1)
print('polygon point ' + ifs.coord.point[index]);
else
print('next polygon ');
}
print('end polygon list');
}
function rotation1_in(value)
{
rot[0] = value[0];
rot[1] = value[1];
rot[2] = value[2];
rot[3] = value[3];
print_polygons();
}
function vec3f1_in(value)
{
pos[0] = value[0];
pos[1] = value[1];
pos[2] = value[2];
print_polygons();
}
"
]
}
ROUTE ProximitySensor1.orientation_changed TO Script1.rotation1_in
ROUTE ProximitySensor1.position_changed TO Script1.vec3f1_in
> I certainly can calculate that ray by point and directionvector. But how do
> I find out if that ray hit the IFS somewhere ?
> And also how do I find out what polygon was hit ?
You will find suggestments from google like:
http://www.exaflop.org/docs/naifgfx/naifpip.html
http://www.siggraph.org/education/m...ntersection.htm
http://www.cs.fit.edu/wds/classes/a...e/raytrace.html
good luck
so long
MUFTI
--
Gehen Sie zur Prozess-Speisekarte, auserlesener Resize, und dann
klicken Sie den Anfall zu Fenster-Knopf an.
(aus einem Software-Handbuch, Stichworte: menu und access)
| |
| Joerg Scheurich aka MUFTI 2004-09-19, 4:16 am |
| > is there any way I can do picking with vrml the following way:
> I want to send out a ray into the space from an arbitary point into an
> arbitary direction.
You need to read the entire scenegraph and then have to continue with
3D mathematics in a scriptnode (preferable java for speed reasons) 8-(
For the cortona browser there is a extension to do this easier/faster.
http://www.parallelgraphics.com/pro...beta/collision/
> I need it for a welding and drilling robot that shall be simulated in vrml.
> That robot can cut/grind the workpiece or weld some new material on the
> workpice. So where ever the robot arm goes the workpiece changes its
> shape...
This is a typical object-object collision question.
VRML/X3D by itself is standard about visualisation, not about simple
physics simulation (yet).
so long
MUFTI
--
Wir haben die Welt gesucht, um allen Arbeitsflaeche-Verlag Beduerfnisse
zu treffen.
(aus einem Softwarehandbuch, Stichwort: desktop-publishing)
| |
| Paul Aslin 2004-09-19, 4:16 am |
|
Blaxxun/BS Contact also has and extension
Browser.computeRayHit(here,there);
where here and there are SFVec3f values
The function returns a SFNode which contains various bits of
information using a custom node.
Best to refer to company documentation on this.
On Wed, 15 Sep 2004 17:28:21 +0200, "Robert Ludewig"
<schwertfischtrombose@gmx.de> wrote:
>Hello
>
>is there any way I can do picking with vrml the following way:
>I want to send out a ray into the space from an arbitary point into an
>arbitary direction.
>In case that ray hits a IndexedFaceSet I want to get the vertices (coords)
>that belong to the face (polygon) that was hit by the ray and then modify
>the position of those vertices (coords).
>Can something like that be done with vrml.
>I need it for a welding and drilling robot that shall be simulated in vrml.
>That robot can cut/grind the workpiece or weld some new material on the
>workpice. So where ever the robot arm goes the workpiece changes its
>shape...
>
>
| |
| Muaddib 2004-09-19, 7:16 pm |
| If the user is specifying where to cut the object using
the current location of the mouse then you can use a TouchSensor.
Enclose the entire target object with it and route the
hitPoint_changed event to your cutting routine. If you set up
your data structures correctly, you can back out which face was
hit and then modify the accompanying vertices.
--
-------------------------------------------------------
VRSpace - An open source, modular, cross-platform,
multi-user vrml system with persistent shared objects.
Check out the Nexus at http://www.vrspace.org/
-------------------------------------------------------
| |
| Robert Ludewig 2004-09-19, 11:19 pm |
|
The Browser I am using does not support java (only javascript/vrmlscript)
its called XROOMS and uses 90% of the source code of balxxuns contact.
It is not possible touse extensions with that viewer.
> You need to read the entire scenegraph and then have to continue with
> 3D mathematics in a scriptnode (preferable java for speed reasons) 8-(
Ermm lets say all there is in the scene is one IFS. Can you describe in
pseudeocde how the procedure for that woul dlook like ?
I certainly can calculate that ray by point and directionvector. But how do
I find out if that ray hit the IFS somewhere ?
And also how do I find out what polygon was hit ?
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |