View Full Version : how to use the client api
jack lee
May 10th, 2011, 11:00
Hello!
I started to work with RealityServer 3.0. I want to write a web service using flex client API.But I find using the API is very difficult.I have some questions to ask!
First, I want to save the rendering picture in the client, and I find the command "SAVE_IMAGE" in the Rs_commands of the flex API, but I don't know how to use it. I write the code like this:
this.mView.add_command(new Rs_command(Rs_commands.SAVE_IMAGE,["d:\test.jpg"]));
but it doesn't work, Can anyone help me?
And, I also want to realize the function like bf3,bf4.., that I can control the "db" myself , but I don't know how to use flex API to solve it. For example in bf4, how to change the texture picture using flex API? I hope someone can give some demo codes.
Last, I use the command "GET_RENDERER" to get the current renderer,
string renderer;
this.mView.add_command(new Rs_command(Rs_commands.GET_RENDERER,[renderer]));
but I still failed.
Can anyone help me to solve these problems? Thanks very much!
Best Regards
Welcome.
FYI: RealityServer 3.1 has been released recently ( click here for more information (http://forum.mentalimages.com/showthread.php?8044-RealityServer-3.1-is-now-available!)). It comes with a new Web Service API and we would recommend writing your first RealityServer Flex application with version 3.1.
Best regards.
jack lee
May 12th, 2011, 03:20
Thanks, but my program must use RS3.0, can you just give some examples of using the RS3.0 flex API?
jack lee
May 12th, 2011, 09:56
Welcome.
FYI: RealityServer 3.1 has been released recently ( click here for more information (http://forum.mentalimages.com/showthread.php?8044-RealityServer-3.1-is-now-available!)). It comes with a new Web Service API and we would recommend writing your first RealityServer Flex application with version 3.1.
Best regards.
Thanks for your reply.
Here, I must realize the function like bf3 and bf4. In bf3, change the lightColor. Now, my code is
this.mView.add_command(new Rs_command( Rs_commands.SET_COLOR_ATTRIBUTE, ["spotLight_shader", ... ] ));
and I know there need another "color" parameter,but in flex API, I can't find the correct type. So ,I would like to konw how to write the code let it right?
And the other question is the element "cradle_material_shader" in bf3, if I want to change the materialColor, I need change several parameters such as specularColor,diffuse_color.. So, should I write the code like this :
this.mView.add_command(new Rs_command( Rs_commands.SET_COLOR_ATTRIBUTE, ["spotLight_shader.specularColor", ... ] ));
Actually, I really want to know whether the Flex API can realize all the functions like the demos(bf1,bf2...)?
Please someone gives me your help. Thanks!
First, I want to save the rendering picture in the client, and I find the command "SAVE_IMAGE" in the Rs_commands of the flex API, but I don't know how to use it. I write the code like this:
this.mView.add_command(new Rs_command(Rs_commands.SAVE_IMAGE,["d:\test.jpg"]));
Saving an image on the client side is a client API question and has nothing to do with the server side services. You will be able to fins some examples for that in the web, e.g. here: http://tinyurl.com/3emuxj2
Best regards.
Thanks, but my program must use RS3.0, can you just give some examples of using the RS3.0 flex API?
We are sorry. As the RS 3.0 development is closed we do not ship new examples for that version.
Again: it is strongly recommended to use the RS 3.1 Web Services, because the API structure (and the examples!) have been completely re-worked. Any application you are creating now with RS 3.0 has to be ported to the 3.1 API anyway in future, so it could be a waste of time.
Why does your application has to use RS 3.0 API? That does not make much sense, especially when you develop your application from scratch.
Best regards.
jack lee
May 13th, 2011, 03:17
We are sorry. As the RS 3.0 development is closed we do not ship new examples for that version.
Again: it is strongly recommended to use the RS 3.1 Web Services, because the API structure (and the examples!) have been completely re-worked. Any application you are creating now with RS 3.0 has to be ported to the 3.1 API anyway in future, so it could be a waste of time.
Why does your application has to use RS 3.0 API? That does not make much sense, especially when you develop your application from scratch.
Best regards.
Thanks very much!
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.