|
From: cheribhai <cha...@gm...> - 2010-03-26 15:48:45
|
Hello,
A couple of questions concerning change in viewpoint.
(1) The VRML97 spec says that 'The jump field specifies whether the user's
view "jumps" to the position and orientation of a bound Viewpoint node or
remains unchanged.'
The way I see it, if jump is true the viewpoint user view transform should
by set to identity, which the following code does.
void openvrml_node_vrml97::viewpoint_node::bind(const bool val,
const double timestamp)
OPENVRML_THROW1(std::bad_alloc)
{
this->is_bound_.value(val);
last_user_view_transform_ = user_view_transform_;
if(this->jump_.value())
this->user_view_transform_ = openvrml::make_mat4f();
node::emit_event(this->is_bound_emitter_, timestamp);
}
Am I right on this?
(2) I am trying to implement viewpoint change animation in a custom browser.
For this it seems that I need the attribute value of
viewpoint_metatype::bind function to be set to visible (OPENVRML_API).
Is this the way to go about what I want to do or is there another way around
this?
cheers - cherian
--
View this message in context: http://old.nabble.com/Viewpoint-change-tp28044359p28044359.html
Sent from the openvrml-develop mailing list archive at Nabble.com.
|
|
From: Braden M. <br...@en...> - 2010-03-30 04:45:49
|
On Fri, 2010-03-26 at 08:48 -0700, cheribhai wrote:
>
>
> Hello,
> A couple of questions concerning change in viewpoint.
> (1) The VRML97 spec says that 'The jump field specifies whether the user's
> view "jumps" to the position and orientation of a bound Viewpoint node or
> remains unchanged.'
> The way I see it, if jump is true the viewpoint user view transform should
> by set to identity, which the following code does.
>
> void openvrml_node_vrml97::viewpoint_node::bind(const bool val,
> const double timestamp)
> OPENVRML_THROW1(std::bad_alloc)
> {
> this->is_bound_.value(val);
> last_user_view_transform_ = user_view_transform_;
> if(this->jump_.value())
> this->user_view_transform_ = openvrml::make_mat4f();
> node::emit_event(this->is_bound_emitter_, timestamp);
> }
>
> Am I right on this?
Yes, I think that looks good.
I thought I remembered getting this stuff working. I was certainly
thinking about it when I wrote the user_view_transform stuff; maybe I
just didn't quite finish the idea.
> (2) I am trying to implement viewpoint change animation in a custom browser.
> For this it seems that I need the attribute value of
> viewpoint_metatype::bind function to be set to visible (OPENVRML_API).
>
> Is this the way to go about what I want to do or is there another way around
> this?
Well, it's not going to be that simple. viewpoint_metatype lives in a
dynamically loaded module; it's not something you'd link against.
Is openvrml_node_vrml97::viewpoint_node::is_bound_ what you really want?
Of course, openvrml_node_vrml97::viewpoint_node lives in the same
dynamically loaded module; but in this case, it's not to hard to expose
functionality by pushing it up to the openvrml::viewpoint_node
interface.
There was a time that I was trying to avoid committing the libopenvrml
interface to the bindable node stack concepts; I was hoping that X3D
would evolve away from that brain damage. But it didn't. So there's a
compelling argument to be made that there's no point in continuing to
run from this.
--
Braden McDaniel <br...@en...>
|
|
From: cheribhai <cha...@gm...> - 2010-03-31 11:14:36
|
I agree. I think viewpoint jumps and animations can be quite useful at times.
In my case I need to actually perform the 'bind' to another viewport, so
isBound is not good enough.
But do you propose exposing the 'bind' method only for the viewpoint_node
(which I think should be enough, since this is probably the only bindable
node that the browser is allowed to manipulate) or are you thinking about a
more general approach?
cheers - cherian
Braden McDaniel wrote:
>
> On Fri, 2010-03-26 at 08:48 -0700, cheribhai wrote:
>>
>>
>> Hello,
>> A couple of questions concerning change in viewpoint.
>> (1) The VRML97 spec says that 'The jump field specifies whether the
>> user's
>> view "jumps" to the position and orientation of a bound Viewpoint node or
>> remains unchanged.'
>> The way I see it, if jump is true the viewpoint user view transform
>> should
>> by set to identity, which the following code does.
>>
>> void openvrml_node_vrml97::viewpoint_node::bind(const bool val,
>> const double timestamp)
>> OPENVRML_THROW1(std::bad_alloc)
>> {
>> this->is_bound_.value(val);
>> last_user_view_transform_ = user_view_transform_;
>> if(this->jump_.value())
>> this->user_view_transform_ = openvrml::make_mat4f();
>> node::emit_event(this->is_bound_emitter_, timestamp);
>> }
>>
>> Am I right on this?
>
> Yes, I think that looks good.
>
> I thought I remembered getting this stuff working. I was certainly
> thinking about it when I wrote the user_view_transform stuff; maybe I
> just didn't quite finish the idea.
>
>> (2) I am trying to implement viewpoint change animation in a custom
>> browser.
>> For this it seems that I need the attribute value of
>> viewpoint_metatype::bind function to be set to visible (OPENVRML_API).
>>
>> Is this the way to go about what I want to do or is there another way
>> around
>> this?
>
> Well, it's not going to be that simple. viewpoint_metatype lives in a
> dynamically loaded module; it's not something you'd link against.
>
> Is openvrml_node_vrml97::viewpoint_node::is_bound_ what you really want?
> Of course, openvrml_node_vrml97::viewpoint_node lives in the same
> dynamically loaded module; but in this case, it's not to hard to expose
> functionality by pushing it up to the openvrml::viewpoint_node
> interface.
>
> There was a time that I was trying to avoid committing the libopenvrml
> interface to the bindable node stack concepts; I was hoping that X3D
> would evolve away from that brain damage. But it didn't. So there's a
> compelling argument to be made that there's no point in continuing to
> run from this.
>
> --
> Braden McDaniel <br...@en...>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> openvrml-develop mailing list
> ope...@li...
> https://lists.sourceforge.net/lists/listinfo/openvrml-develop
>
>
--
View this message in context: http://old.nabble.com/Viewpoint-change-tp28044359p28094392.html
Sent from the openvrml-develop mailing list archive at Nabble.com.
|
|
From: Braden M. <br...@en...> - 2010-04-01 02:05:37
|
On Wed, 2010-03-31 at 04:14 -0700, cheribhai wrote: > I agree. I think viewpoint jumps and animations can be quite useful at times. > In my case I need to actually perform the 'bind' to another viewport, so > isBound is not good enough. > > But do you propose exposing the 'bind' method only for the viewpoint_node > (which I think should be enough, since this is probably the only bindable > node that the browser is allowed to manipulate) or are you thinking about a > more general approach? If that's what you want, why not just send an event to the Viewpoint node's "set_bind" eventIn? If we do start exposing the bound node stack via libopenvrml's API, this is something that ought to be done generally and consistently for all bindable nodes. An approach I'm thinking of would have bindable types registering themselves somehow with the browser (or possibly the scene), which would provide (and expose) the actual bound node stack logic. -- Braden McDaniel <br...@en...> |