|
Anyone knows how to convert a deldir$delsgs to a X3D IndexedTriangleSet?
Are there already any functions/packages? [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
Oh, sorry: X3D is an interchange format for 3D scenes (s [1])...
X3D's IndexedTriangleSet is a visual component to describe a complex figure to be visualized by triangles (s. [2]) I would like to triangulate a pointset (2.5D DEM consisting of xy coords and height) using deldir and convert the result back to a IndexedTriangelSet to visualize in a X3D browser. [1] http://en.wikipedia.org/wiki/X3D [2] http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/rendering.html#IndexedTriangleSet 2012/7/19 Rolf Turner <[hidden email]> > On 19/07/12 01:13, Erdal Karaca wrote: > >> Anyone knows how to convert a deldir$delsgs to a X3D IndexedTriangleSet? >> Are there already any functions/packages? >> >> > If I knew WTF a "X3D IndexedTriangleSet" was, I might be able > to help you. To quote Prof. Ripley, "R is lacking a mind_read() > function!" > > cheers, > > Rolf Turner > > [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
On 19/07/12 18:36, Erdal Karaca wrote:
> Oh, sorry: X3D is an interchange format for 3D scenes (s [1])... > X3D's IndexedTriangleSet is a visual component to describe a complex > figure to be visualized by triangles (s. [2]) > > I would like to triangulate a pointset (2.5D DEM consisting of xy > coords and height) using deldir and convert the result back to a > IndexedTriangelSet to visualize in a X3D browser. > > [1] http://en.wikipedia.org/wiki/X3D > [2] > http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/rendering.html#IndexedTriangleSet > > 2012/7/19 Rolf Turner <[hidden email] > <mailto:[hidden email]>> > > On 19/07/12 01:13, Erdal Karaca wrote: > > Anyone knows how to convert a deldir$delsgs to a X3D > IndexedTriangleSet? > Are there already any functions/packages? > > > If I knew WTF a "X3D IndexedTriangleSet" was, I might be able > to help you. To quote Prof. Ripley, "R is lacking a mind_read() > function!" > This seems to be an X3D question rather than an R question. I can, and would be willing to, write code to convert output from deldir() into an R object of any appropriate form. I am not willing to write code to output an R object to a text file in a format amenable for use by X3D. Which seems to be what you want. I don't think that would be too hard to do, for someone familiar with the X3D protocol --- just use a lot of calls to cat() perhaps --- but it's not my job and I have other things to do with my time. cheers, Rolf Turner P. S. If you just want code to convert deldir output to a convenient form of *R object*, let me know clear and precise specifications of what you want the form to be --- with an *example* of an object of the appropriate form (use dput()) --- and I'll see what I can do. R. T. [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
Oh, I dont want anyone to do anything for me. I am just asking for
hints/infos to be able to do it myself... I was hoping that someone has already done this... But anyways, I will post my solution once I have succeeded... Thanks for the support! 2012/7/19 Rolf Turner <[hidden email]> > On 19/07/12 18:36, Erdal Karaca wrote: > > Oh, sorry: X3D is an interchange format for 3D scenes (s [1])... > X3D's IndexedTriangleSet is a visual component to describe a complex > figure to be visualized by triangles (s. [2]) > > I would like to triangulate a pointset (2.5D DEM consisting of xy coords > and height) using deldir and convert the result back to a > IndexedTriangelSet to visualize in a X3D browser. > > [1] http://en.wikipedia.org/wiki/X3D > [2] > http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/rendering.html#IndexedTriangleSet > > 2012/7/19 Rolf Turner <[hidden email]> > >> On 19/07/12 01:13, Erdal Karaca wrote: >> >>> Anyone knows how to convert a deldir$delsgs to a X3D IndexedTriangleSet? >>> Are there already any functions/packages? >>> >>> >> If I knew WTF a "X3D IndexedTriangleSet" was, I might be able >> to help you. To quote Prof. Ripley, "R is lacking a mind_read() >> function!" >> > > This seems to be an X3D question rather than an R question. I can, > and would be willing to, write code to convert output from deldir() > into an R object of any appropriate form. I am not willing to write > code to output an R object to a text file in a format amenable > for use by X3D. Which seems to be what you want. > > I don't think that would be too hard to do, for someone familiar > with the X3D protocol --- just use a lot of calls to cat() perhaps > --- but it's not my job and I have other things to do with my time. > > cheers, > > Rolf Turner > > P. S. If you just want code to convert deldir output to a convenient form > of *R object*, let me know clear and precise specifications of what you > want the form to be --- with an *example* of an object of the appropriate > form (use dput()) --- and I'll see what I can do. > > R. T. > [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
On 19/07/12 20:40, Erdal Karaca wrote:
> Oh, I dont want anyone to do anything for me. I am just asking for > hints/infos to be able to do it myself... > I was hoping that someone has already done this... > But anyways, I will post my solution once I have succeeded... If you haven't already looked at it, you may find it helpful to experiment with the "triang.list()" function and the "z" argument to "deldir()". If I understand correctly what you are after, the output of triang.list() may go some way toward providing it. cheers, Rolf Turner ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
I have managed to use the tripack package which is a bit simpler to use
(for me) and performs better (timely)... ################################################## # inputFile format: x y z inputFile <- "d:\\inputfile.xyz.txt" # output file will contain a x3d scene embedded in a html file to be viewed in a browser supporting WebGL/X3DOM outputFile <- "d:\\scene.x3d.html" library(tripack) points <- read.table( inputFile ) mesh <- tri.mesh(x, y) tris <- triangles(mesh) nodes <- cbind(tris[,1], tris[,2], tris[,3]) write("<html><head><link rel='stylesheet' type='text/css' href=' http://www.x3dom.org/download/x3dom.css'></link></head><body> <X3D profile='Interchange' style='width:100%;height100%'><Scene><Transform><Shape DEF='river'> <Appearance><Material ambientIntensity='0.0' diffuseColor='0.7 0.4 0' shininess='1.0'/></Appearance> <IndexedTriangleSet index='", file=outputFile, append=FALSE) write.table(nodes, file=outputFile, row.names=FALSE, col.names=FALSE, append = TRUE) write("'><Coordinate point='", file=outputFile, append=TRUE) write.table(cbind(x,y,z), file=outputFile, row.names=FALSE, col.names=FALSE, append = TRUE) write("'/></IndexedTriangleSet></Shape></Transform></Scene></X3D> <script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'></script></body></html>", file=outputFile, append=TRUE) ################################################## 2012/7/20 Rolf Turner <[hidden email]> > On 19/07/12 20:40, Erdal Karaca wrote: > >> Oh, I dont want anyone to do anything for me. I am just asking for >> hints/infos to be able to do it myself... >> I was hoping that someone has already done this... >> But anyways, I will post my solution once I have succeeded... >> > > If you haven't already looked at it, you may find it helpful to experiment > with the "triang.list()" function and the "z" argument to "deldir()". > > If I understand correctly what you are after, the output of triang.list() > may go some way toward providing it. > > cheers, > > Rolf Turner > [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
| Powered by Nabble | Edit this page |
