Results 1 to 7 of 7

Thread: how to use the client api

  1. #1
    Join Date
    May 2011
    Posts
    28

    Default how to use the client api

    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:
    Code:
    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,
    Code:
    			 
    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
    Last edited by jack lee; May 12th, 2011 at 09:58.

  2. #2
    Join Date
    Jan 2007
    Location
    Berlin
    Posts
    789

    Default

    Welcome.

    FYI: RealityServer 3.1 has been released recently ( click here for more information). It comes with a new Web Service API and we would recommend writing your first RealityServer Flex application with version 3.1.

    Best regards.

  3. #3
    Join Date
    May 2011
    Posts
    28

    Default

    Thanks, but my program must use RS3.0, can you just give some examples of using the RS3.0 flex API?

  4. #4
    Join Date
    May 2011
    Posts
    28

    Default

    Quote Originally Posted by ak View Post
    Welcome.

    FYI: RealityServer 3.1 has been released recently ( click here for more information). 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
    Code:
    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 :
    Code:
    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!
    Last edited by jack lee; May 12th, 2011 at 10:12.

  5. #5
    Join Date
    Jan 2007
    Location
    Berlin
    Posts
    789

    Default

    Quote Originally Posted by jack lee View Post
    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:
    Code:
    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.

  6. #6
    Join Date
    Jan 2007
    Location
    Berlin
    Posts
    789

    Default

    Quote Originally Posted by jack lee View Post
    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.

  7. #7
    Join Date
    May 2011
    Posts
    28

    Default

    Quote Originally Posted by ak View Post
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •