Re: [osg-users] Scale model node to specific size

2020-02-11 Thread OpenSceneGraph Users
Thanks Alberto. The answer helped me to resize the model as required.

On Thursday, September 12, 2013 at 8:04:52 PM UTC+8, Alberto Luaces wrote:
>
> "Zev Lix" writes: 
>
> > Hi, I wonder if there is a way of scaling a model to a specific size? 
> > So if i have two models that have different sizes when loaded into 
> > osg, i want to scale these two models so that they have the same 
> > lenght or width. 
> > 
> > Example if i have two models of cars they should both have X length in 
> > my osg application regardless of how big they were when created in 
> > some model program. 
> > 
> > I know i could just create the models in the right size to start 
> > with. but this is a problem when adding models made by other people. 
>
> Hi Zev, you can get the total dimensions with the osg::BoundingBox of 
> the object.  Later you can scale it to the right size placing it under a 
> osg::MatrixTransform node with a scale matrix. 
>
> -- 
> Alberto 
>
> ___ 
> osg-users mailing list 
> osg-...@lists.openscenegraph.org  
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/17dff320-6f27-4d59-8b7d-ef3537a1fd35%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scale model node to specific size

2013-09-12 Thread Alberto Luaces
"Zev Lix" writes:

> Hi, I wonder if there is a way of scaling a model to a specific size?
> So if i have two models that have different sizes when loaded into
> osg, i want to scale these two models so that they have the same
> lenght or width.
>
> Example if i have two models of cars they should both have X length in
> my osg application regardless of how big they were when created in
> some model program.
>
> I know i could just create the models in the right size to start
> with. but this is a problem when adding models made by other people.

Hi Zev, you can get the total dimensions with the osg::BoundingBox of
the object.  Later you can scale it to the right size placing it under a
osg::MatrixTransform node with a scale matrix.

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Scale model node to specific size

2013-09-12 Thread Zev Lix
Hi,
I wonder if there is a way of scaling a model to a specific size? So if i have 
two models that have different sizes when loaded into osg, i want to scale 
these two models so that they have the same lenght or width.

Example if i have two models of cars they should both have X length in my osg 
application regardless of how big they were when created in some model program.

I know i could just create the models in the right size to start with. but this 
is a problem when adding models made by other people.

Thank you!

Cheers,
Zev

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56075#56075





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org