| Author |
mesh deform/ vertex transfrom with vrml
|
|
| Robert Ludig 2004-08-31, 7:16 am |
| Hello,
Is there any way to deform a mesh with vrml ? I want to acess some
vertices of a mesh and move them to a new position..
Or maybe a workaround ....
| |
| Robert Ludig 2004-08-31, 12:19 pm |
| I forgot something:
Do you think there is a way to add or remove vertices at runtime from /
to a mesh ??
| |
| Robert Ludig 2004-08-31, 12:19 pm |
| let me see if I understood it right:
the first 16 Keyvalues are the position of the 16 vertices at fraction
0 (key) and
the last 16 KeyValues are the position of the 16 vertices at fraction
0.961702 (key)
that brings me to one problem:
it seems like I always have to specify ALL vertices of my model inside
KeyValue [] even those ones who don`t move. Now I have a rather complex
model consisting of over 2000 vertices and I only want to animate just
some (10) of them. Now for each animation step those few verticves
should do I would have to specify over 2000 KeyValues. Of course that
is impractical.
Do you see any workaround for that ???
P.S:
Maybe after all I should tell you what I am doing:
You might just come up with ideas how to visualize that with vrml.
I am creating a visualistion software for a "rapid prototyping robot"
at FRaunhofer Inastitute in Dresden, Germany. My java tool simply
generates vrml files, for the user to view.
This is what the users sees:
A laser moves in space. It is focused on a horizontal plane. At that
focus point some metal pulver is blown and the laser melts it down to
solid structure. So where ever the laser goes on that plane it leaves a
trail of solid metal. And so it can build any arbitary object because
it builds level by level on top of each other.
My idea to animate this build process was this:
at first there is a high res plane (maybe 1000 x 1000 vertices) and
whereever the laser goes the vertices that get hit by the laser (and
some of the neighbors (soft selction) ) get pulled up a little bit. All
this claclulation is done in the java app wich finally spits out the
static animation vrml file. So I need to find a way to acess JUST SOME
vertices aned move those. Specifying all 1000x1000 vertices for each
vertex move is of course not applicable ....
I would really appreciate , if you would give me a hint on this one.
| |
|
|
Yes, easily.
Access the points of an IFS from a script node and change them.
"Robert Ludig" <schwertfischtrombose@gmx.de> wrote in message
news:cgf7i3$gee@odbk17.prod.google.com...
> Hello,
>
> Is there any way to deform a mesh with vrml ? I want to acess some
> vertices of a mesh and move them to a new position..
> Or maybe a workaround ....
>
| |
| Joerg Scheurich aka MUFTI 2004-08-31, 11:16 pm |
| >> Is there any way to deform a mesh with vrml ? I want to acess some
[color=darkred]
> Yes, easily.
> Access the points of an IFS from a script node and change them.
Not needed.
Simply use a CoordinateInterpolator
#VRML V2.0 utf8
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry IndexedFaceSet
{
coord DEF Coordinate1 Coordinate
{
point
[
1 -0.999999 0
-1.699999 -0.999999 0
0 -0.999999 0
-1.740000 -0.999999 0
0 -0.489041 -0.872260
-0.760838 -0.489041 0.426571
0.760838 -0.489041 0.426571
-1.370496e-7 -0.489041 -0.872260
0 0.489041 -0.872260
-0.760838 0.489041 0.426571
0.760838 0.489041 0.426571
-1.800000 0.489041 -0.872260
0 0.999999 0
-2.480000 0.999999 0
0 0.999999 0
-2.480000 2 0
]
}
coordIndex
[
0 5 4 -1
1 6 5 -1
2 7 6 -1
4 5 9 8 -1
5 6 10 9 -1
6 7 11 10 -1
8 9 13 -1
9 10 14 -1
10 11 15 -1
]
}
}
]
}
DEF TimeSensor1 TimeSensor
{
cycleInterval 10
loop TRUE
}
DEF CoordinateInterpolator1 CoordinateInterpolator
{
key
[
0
0.961702
]
keyValue
[
0 -0.999999 0
0 -0.999999 0
0 -0.999999 0
0 -0.999999 0
0 -0.489041 -0.872260
-0.760838 -0.489041 0.426571
0.760838 -0.489041 0.426571
-1.370496e-7 -0.489041 -0.872260
0 0.489041 -0.872260
-0.760838 0.489041 0.426571
0.760838 0.489041 0.426571
-1.370496e-7 0.489041 -0.872260
0 0.999999 0
0 0.999999 0
0 0.999999 0
0 0.999999 0
1 -0.999999 0
-1.699999 -0.999999 0
0 -0.999999 0
-1.740000 -0.999999 0
0 -0.489041 -0.872260
-0.760838 -0.489041 0.426571
0.760838 -0.489041 0.426571
-1.370496e-7 -0.489041 -0.872260
0 0.489041 -0.872260
-0.760838 0.489041 0.426571
0.760838 0.489041 0.426571
-1.800000 0.489041 -0.872260
0 0.999999 0
-2.480000 0.999999 0
0 0.999999 0
-2.480000 2 0
]
}
ROUTE TimeSensor1.fraction_changed TO CoordinateInterpolator1.set_fraction
ROUTE CoordinateInterpolator1.value_changed TO Coordinate1.set_point
| |
| Robert Ludewig 2004-09-01, 7:16 am |
| errm, do you have an example of how to acesss points of a IFS via a script
node, or can you tell me the crucial vrmlscript -commands ?
"sam" <sam3dus@yahoo.com> schrieb im Newsbeitrag
news:7PMWc.32412$9Y6.13598@newsread1.news.pas.earthlink.net...
>
> Yes, easily.
> Access the points of an IFS from a script node and change them.
>
>
> "Robert Ludig" <schwertfischtrombose@gmx.de> wrote in message
> news:cgf7i3$gee@odbk17.prod.google.com...
>
>
| |
|
| Oops, it's IndexedFaceSet, not IndexedFrameSet ...
| |
|
| "Robert Ludig" <schwertfischtrombose@gmx.de> wrote in news:cggi72
$n4m@odak26.prod.google.com :
> I forgot something:
>
> Do you think there is a way to add or remove vertices at runtime from /
> to a mesh ??
>
I'm not absolutely sure about the meaning of "vertices" (in french !), but
if you want to add/remove some "faces", there I can help you :
index = MyIFS.coordIndex.length; // define a new vertice with :
MyIFS.coordIndex[index+0] = 0; //point #0
MyIFS.coordIndex[index+1] = 1; //point #1
MyIFS.coordIndex[index+2] = 2; //point #2
MyIFS.coordIndex[index+3] = -1; //ends the face definition
Bye
O.L.
| |
| Robert Ludig 2004-09-02, 7:15 am |
| Mhh, there is only one problem, how do I change the position of the
coords later in time?
After each second that passes I want to change some other coords. So
that after 200 seconds all coords have a new position.
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |