OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Adapting a height field with a triangle/polygon?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
reedev
User


Joined: 25 Feb 2009
Posts: 85

PostPosted: Tue Sep 05, 2017 7:16 am    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Hi everyone,

I have a question about the implementation of an idea: I would like to
adapt the vertices in a height field based on a triangle/polygon. So I
would like to start with a height field and push/pull vertices with a
triangle/polygon so that the height field is flattened according to the
triangle/polygon.

This is a pretty new area for me so does someone have pointers to
example code? I have browsed the examples but cannot find pointers at
the moment. I am probably looking in the wrong places at the moment...

Thanks a lot, cheers,
Raymond



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
michael.connell@gmail.com
Newbie


Joined: 11 Apr 2012
Posts: 14

PostPosted: Tue Sep 05, 2017 2:04 pm    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Checkout osgtds - an old project Don Burns worked on, I doubt it still compiles these days, but may be of interest.

best wishes


/Mike


On 5 September 2017 at 09:13, Raymond de Vries < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi everyone,

I have a question about the implementation of an idea: I would like to adapt the vertices in a height field based on a triangle/polygon. So I would like to start with a height field and push/pull vertices with a triangle/polygon so that the height field is flattened according to the triangle/polygon.

This is a pretty new area for me so does someone have pointers to example code? I have browsed the examples but cannot find pointers at the moment. I am probably looking in the wrong places at the moment...

Thanks a lot, cheers,
Raymond

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
reedev
User


Joined: 25 Feb 2009
Posts: 85

PostPosted: Tue Sep 05, 2017 8:22 pm    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Hi Mike,


Thanks for your suggestion, the manual looks interesting. Any idea where a recent copy can be fetched?


Cheers, thanks,
Raymond


Verstuurd vanaf mijn iPad


Op 5 sep. 2017 om 16:02 heeft Mike Connell < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> het volgende geschreven:


Quote:
Checkout osgtds - an old project Don Burns worked on, I doubt it still compiles these days, but may be of interest.

best wishes


/Mike


On 5 September 2017 at 09:13, Raymond de Vries < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi everyone,

I have a question about the implementation of an idea: I would like to adapt the vertices in a height field based on a triangle/polygon. So I would like to start with a height field and push/pull vertices with a triangle/polygon so that the height field is flattened according to the triangle/polygon.

This is a pretty new area for me so does someone have pointers to example code? I have browsed the examples but cannot find pointers at the moment. I am probably looking in the wrong places at the moment...

Thanks a lot, cheers,
Raymond

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11154

PostPosted: Wed Sep 06, 2017 8:25 am    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Hi Raymond,


There a number of ways of mixing polygonal data with height fields, the best way will depend upon the requirements/constraints of your application. 



If you need exactly intersections then converting the height fields into a polygon mesh and then inserting the vertices and edges from the mesh you want to add will be required. This will be slow so something you'll likely want to do as a pre-processing stage.  The osgTDS code that Don wrote many years back uses this approach.  I'm afraid I don't have an insights into osgTDS or where to get it these days.


If you don't need exact match then you could possible modify the height fields values to match the polygonal mesh, you could do this on the CPU as a pre-processing step, or render the polygonal mesh to a depth texture and then use a vertex shader to read from two depth/height field textures to render a single heightfield.


Another approach would be to use a constructive solid modelling approach, at least I have hunch you could do this somehow but would need to think it through fully first.


Given more time I'm sure I could come up with half a dozen more approaches that may or may not work Smile



Robert.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 789

PostPosted: Wed Sep 06, 2017 10:30 am    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Hi Raymond,

If you're okay with having a regular mesh after your editing operation
you can either use a vertex-texture that you modify or you can adapt a
osgTerrain::GeometryTechnique to generate modified geometry patches.
I've done this once for a game that used SimCity-style terrain
sculpting. I can share portions of the code with you privately.

Cheers
Sebastian
Quote:
Hi everyone,

I have a question about the implementation of an idea: I would like to
adapt the vertices in a height field based on a triangle/polygon. So I
would like to start with a height field and push/pull vertices with a
triangle/polygon so that the height field is flattened according to the
triangle/polygon.

This is a pretty new area for me so does someone have pointers to
example code? I have browsed the examples but cannot find pointers at
the moment. I am probably looking in the wrong places at the moment...

Thanks a lot, cheers,
Raymond




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
reedev
User


Joined: 25 Feb 2009
Posts: 85

PostPosted: Thu Sep 07, 2017 7:06 am    Post subject:
Adapting a height field with a triangle/polygon?
Reply with quote

Hi everyone,

Thanks a lot for your suggestions. Based on your extra remarks, we will make up our minds and go on.

Cheers,
Raymond





On 6-9-2017 10:23, Robert Osfield wrote:

Quote:
Hi Raymond,


There a number of ways of mixing polygonal data with height fields, the best way will depend upon the requirements/constraints of your application. 



If you need exactly intersections then converting the height fields into a polygon mesh and then inserting the vertices and edges from the mesh you want to add will be required. This will be slow so something you'll likely want to do as a pre-processing stage.  The osgTDS code that Don wrote many years back uses this approach.  I'm afraid I don't have an insights into osgTDS or where to get it these days.


If you don't need exact match then you could possible modify the height fields values to match the polygonal mesh, you could do this on the CPU as a pre-processing step, or render the polygonal mesh to a depth texture and then use a vertex shader to read from two depth/height field textures to render a single heightfield.


Another approach would be to use a constructive solid modelling approach, at least I have hunch you could do this somehow but would need to think it through fully first.


Given more time I'm sure I could come up with half a dozen more approaches that may or may not work Smile



Robert.















[/url] Virusvrij. [url=http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient]www.avg.com [url=#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2][/url]


Quote:
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change "field of view&quo... gambr General 3 Mon Aug 07, 2017 1:37 pm View latest post
No new posts OSG-GLSL triangle adjacency boulbo General 3 Thu Jul 20, 2017 2:43 pm View latest post
No new posts Near-uniform tessellation of a concav... Kanpachi General 3 Wed Apr 19, 2017 12:13 pm View latest post
No new posts Polygon Rendering bhanu406 General 1 Thu Mar 16, 2017 9:18 am View latest post
No new posts How to query height of terrain given ... vinothrajendran4 VirtualPlanetBuilder [vpb] 0 Tue Mar 14, 2017 2:43 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP