Re: [osg-users] Render normal vectors to image

2019-11-12 Thread Han Hu
Hi, Thank you, Glenn! This is what I need! Cheers, Han -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76905#76905 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Render normal vectors to image

2019-11-11 Thread Han Hu
Hi, Thank you, Glenn. Another less related question. My model is pagedlod in osgb format, which does not contain normal vectors. How can add callback functions, to dynamically calculate the normal vectors and attach it to the normal buffer, when loading? Cheers, Han -- Read

Re: [osg-users] Render normal vectors to image

2019-11-11 Thread Han Hu
Hi, Thanks! I can use osgUtil to compute the normal vectors on the fly. My question is how to render the per-vertex or per-triangles to the image, e.g. the color is the (x,y,z) of the normal vector, rather than the color of texture. Cheers, Han -- Read this topic online here:

[osg-users] Render normal vectors to image

2019-11-11 Thread Han Hu
Hi, I would like to do offscreen rendering of a mesh. Currently, I have suceeded to do this for both the color (RGB) and depth data using the built-in functions as below. Code: osg::ref_ptr rttImage = new osg::Image; osg::ref_ptr depthImage = new osg::Image;

[osg-users] Render normal vectors to image

2019-11-11 Thread Han Hu
Hi, I would like to do offscreen rendering of a mesh. Currently, I have suceeded to do this for both the color (RGB) and depth data using the built-in functions as below. Code: osg::ref_ptr rttImage = new osg::Image; osg::ref_ptr depthImage = new osg::Image;

[osg-users] Large scale point clouds rendering with PagedLOD

2019-03-08 Thread Han Hu
Hi, I am now doing point clouds rendering (probably city-scale) using osg. The point clouds are indexed using entwine (https://entwine.io/) to the ept format. Basically, we know the bounding box of the entire scene, and the point clouds are saved to disk with the name D-x-y-z.laz, where D is

Re: [osg-users] Backward compatibility of osgb file through Schema

2017-11-02 Thread Han Hu
Thanks anyway, this is in fact what I felt after looking into the code in the OutputStream code, because it seems that it changes some way to write data and add some new fields without version guard. I think the only way is to write my own write callback and set to the options parameter. Han

Re: [osg-users] Backward compatibility of osgb file through Schema

2017-11-02 Thread Han Hu
Hi Robert, My problem is that my osg version is osg 3.5.5, which I convert an obj file to osgb just by readRefNodeFile and writeNodeFile. But I am targeting to other software, which may use some lower version of osg. I have tried osgconv in OSG 3.4.0 and the other software accept. So there

[osg-users] Backward compatibility of osgb file through Schema

2017-11-02 Thread Han Hu
Hi, I am using a newer osg version to develop my software and I need to export the model in osgb file for other software, in an acient osg version. I have googled that it is possible to control the compatibility through the SchemaFile. However, I have found little information on how to use it.

Re: [osg-users] Does osgb file has compatible issues with older osg versions?

2017-06-07 Thread Han Hu
the SO version which to limit the > export to. You'll need to use this class directly rather than rely > upon the osg plugin to create and use this for you. > > Robert. > > On 6 June 2017 at 13:01, Han Hu <> wrote: > > > Hi, > > > > I have

[osg-users] Does osgb file has compatible issues with older osg versions?

2017-06-06 Thread Han Hu
Hi, I have developed an triangle mesh editing software, the data edited are a pagedlod data in osgb format. And I have used the latest development release to save the output in osgb. The accompanying osgViewer is capable to open my exported data. However, my target software to use my data is

Re: [osg-users] How to use frame buffer object in existing (not osg) window and pipeline.

2017-02-18 Thread Han Hu
Hi Robert, Thanks for your suggestion, I understand the bettter way is to use osg in all the pipeline. But the ugly fact is that I have to use existing pipeline and inject the view.frame() inside a fbo binding, and hope osg will draw the things onto the fbo texture and depth. Because I can't

[osg-users] How to use frame buffer object in existing (not osg) window and pipeline.

2017-02-17 Thread Han Hu
Hi, I know OSG viewer can render into other window as shown in the glutviewer and sdl viewer example. But I do not know how to use fbo for this kind of work. The following code describes my purpose. Code: osg::ref_ptr viewer; /* The vierwer is properly set up for other window*/

Re: [osg-users] writeNodeFile with texture infomation

2016-09-18 Thread Han Hu
I have figured out a solution. The steps are as the following, the core file for the solution lies in OutputStream::writeImage function. 1. To write a image (e.g., *.jpg) inside a file, we need the WRITE_INLINE_FILE mode, which is set by Code: osgDB::Options options;

[osg-users] writeNodeFile with texture infomation

2016-09-17 Thread Han Hu
Hi, I am currently doing some preprocessing with textured meshes and save the output node to another file. The input node is osgb and has texture information embedded. However after SmoothVisitor and using the writeNodeFile to another osgb file, the texture file is missing. The same problem

[osg-users] PagedLOD in hooked context

2016-08-16 Thread Han Hu
Hi, Here is my problem. I am developing a plugin for a software, which the rendering is based on OpenGL. Because it does not have any API for custom rendering support, I hooked the SwapBuffer API of windows to my function (say h_SwapBuffer), that I know is called in every frame. And in

Re: [osg-users] hook osg into other window

2016-08-01 Thread Han Hu
Hi Sebastian , Sketchup doesn't have any API to allow render into its openGL context. And thanks for your snippet on handling the HWND. But I think the real problem lies in that I do not have access to the render loop. So there is nowhere for me to place the viewer->frame() to render the

[osg-users] hook osg into other window

2016-07-31 Thread Han Hu
Hi, Here is my problem. I am writing a plugin for a 3D modeling software , sketchup, and going to draw some 3D things into the OpenGL context. But it does not have any Api for customizing the rendering. So I have to hook my rendering stuffs into its render loop, which I do not have access. I