Trying to move an objects

2 views
Skip to first unread message

raja.a...@gmail.com

unread,
Sep 20, 2010, 9:02:34 PM9/20/10
to SceneJS
Hi
I want to move an object based on mouse click. I setting X and Y in
the mousemove event. But i am not getting the required moment. Can you
suggest what needs to be done here.

Thanks
Raja Sekhar

Lindsay Kay

unread,
Sep 20, 2010, 9:43:46 PM9/20/10
to SceneJS
Hi Raja,

can you post a code example and we'll take a look..

cheers,
Lindsay

On Sep 21, 1:02 pm, "raja.amir...@gmail.com" <raja.amir...@gmail.com>
wrote:

raja.a...@gmail.com

unread,
Sep 20, 2010, 10:13:15 PM9/20/10
to SceneJS
Hi Lindsay,
var cart = SceneJS.getNode("myModel.Model");
In mousemove event i am setting
cart1.setXYZ({ x: speed ,y:speed, z: 0 })
I am not getting the required movement.
Thanks,
Raja Sekhar

Lindsay Kay

unread,
Sep 20, 2010, 10:37:06 PM9/20/10
to SceneJS
Hi Raja,

there are so many things that could be going wrong with that - you
need to supply the whole scene for us to be sure - then I think we can
pick where you're having trouble very quickly.

Possibly what you're doing is assuming that nodes contain both
transforms and geometry, as some scene graph APIs do. However in
SceneJS everything is split up into distinct node classes.

To set XYZ, what you've posted assumes that cart is a Translate
node...and of course you would need to be repeatedly rendering frames
to see an update.

So if you could, please post the whole JS file, and see if you have
any JS error messages. GitHub gists or pasties would be a good way to
share code examples.

cheers,
Lindsay

On Sep 21, 2:13 pm, "raja.amir...@gmail.com" <raja.amir...@gmail.com>

Raja Sekhar

unread,
Sep 20, 2010, 10:53:35 PM9/20/10
to sce...@googlegroups.com
Hi Lindsay,
In order to get the moment what needs to be done.You said we need to render whole scene.

Please advice.

Thanks,
Raja Sekhar

2010/9/21 Lindsay Kay <lindsays...@gmail.com>



--
Raja Sekhar Amirapu
Flat No 201,Tejha Residency,
Chandanagar
Hyderabad
http://rajaamir.blogspot.com

Lindsay Kay

unread,
Sep 20, 2010, 11:02:13 PM9/20/10
to SceneJS
Hi Raja,

could you please post your entire JavaScript file here?

On Sep 21, 2:53 pm, Raja Sekhar <raja.amir...@gmail.com> wrote:
> Hi Lindsay,
> In order to get the moment what needs to be done.You said we need to render
> whole scene.
>
> Please advice.
>
> Thanks,
> Raja Sekhar
>
> 2010/9/21 Lindsay Kay <lindsaystanley...@gmail.com>

Raja Sekhar

unread,
Sep 20, 2010, 11:57:58 PM9/20/10
to sce...@googlegroups.com
Hi Lindsay,
I have got it finally, I have hold of entire cart and it was moving.
 
Thanks anyway.
3D stuff is amazing.
Regards,
Raja Sekhar

2010/9/21 Lindsay Kay <lindsays...@gmail.com>
Reply all
Reply to author
Forward
0 new messages