Change font size
It is currently Fri Apr 19, 2019 6:04 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 8 posts ]
Author Message
 Post subject: Parcel Map
PostPosted: Tue Oct 02, 2018 6:13 pm 

Joined: Mon Sep 24, 2018 1:43 am
Posts: 1
Evening everyone, it's nice to grab the region texture's uuid and display it with osGetMapTexture() however is there a call to show parcel borders or parcels up for 'sale'? I was thinking about using osSetDynamicTextureData and define the parcel borders but not sure if there's another way as the end goal is to display a map of available land to those that visit my regions.

-Logan


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Wed Oct 03, 2018 10:45 am 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 166
Location: Belgium / Brussels
To my knowledge, there is currently no OSSL function for tracing the borders of the different parcels of a region.
You could ask on the Mantis of Opensim to have a new function for tracing the parcels.

Otherwise, you could get a result of a "web" image (like GetTexture Service or Map Image Servive) of the region and draw yourself the boundaries on the image of the region with the osDrawLine or osDrawRectangle functions or with php and a external library like Imagick ...

Or you could make a screen of your area with the parcels drawn with different prims and once the sceen done, you erase the prims of tracing.

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Sun Jan 06, 2019 3:30 pm 

Joined: Mon Jul 19, 2010 3:30 am
Posts: 8
This will display parcel boundaries over region map on face 0 of prim:

//Sim Parcel Mapping
//Total Sorbet Jan 2019

integer resolution=256;
integer timer_chunksize=26;

integer parcels;
string cmd;
integer iterx;
integer itery;

addline(integer x1,integer y1,integer x2,integer y2)
{
y1=parcels-y1-1;y2=parcels-y2-1;++x1;++x2;
float ps=(integer)resolution/(parcels-1);
cmd+="MoveTo "+(string)(x1*ps)+","+(string)(y1*ps)+";LineTo "+(string)(x2*ps)+","+(string)(y2*ps)+";";
}

default
{
on_rez(integer p){llResetScript();}
state_entry()
{
llSetTexture(osGetMapTexture(),0);
vector s=osGetRegionSize();
parcels=(integer)(s.x/4.0);
iterx=0;itery=0;
llSetTimerEvent(0.5);
}
timer()
{
llSetTimerEvent(0);
llResetTime();
while(itery<parcels && iterx<parcels && llGetTime()<timer_chunksize)
{
string t=llList2String(llGetParcelDetails(<iterx<<2,itery<<2,0>,[PARCEL_DETAILS_ID]),0);
if(iterx<parcels-1)if(t!=llList2String(llGetParcelDetails(<(iterx+1)<<2,itery<<2,0>,[PARCEL_DETAILS_ID]),0))addline(iterx,itery-1,iterx,itery);
if(itery<parcels-1)if(t!=llList2String(llGetParcelDetails(<iterx<<2,(itery+1)<<2,0>,[PARCEL_DETAILS_ID]),0))addline(iterx-1,itery,iterx,itery);
if(++iterx==parcels){++itery;iterx=0;}
}
if(itery<parcels)llSetTimerEvent(0.5);
else
{
osSetDynamicTextureDataBlendFace("","vector","PenSize 1;PenColor FFFFFF00;"+cmd,"width:"+(string)resolution+",height:"+(string)resolution+",alpha:0",TRUE,2,0,255,0);
cmd="";
llSay(0,"done");
}
}
}


Last edited by Total Sorbet on Mon Jan 07, 2019 7:24 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Sun Jan 06, 2019 8:42 pm 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 166
Location: Belgium / Brussels
Hi Total Sorbet, Nice job! :)

Your script drove me crazy for a moment ...

Indeed, it worked very well on Sandbox Plaza for example but did not work at all on my simulators.
It appears that on server hosted Linux everything is fine with your script but not on Windows.
it seems that under Linux, the penultimate parameter of the function dynamic texture data blend face, the alpha, has no effect ... but under Windows it works.
By modifying this parameter with the value 255 your script works well under Windows and Linux.

Relief, I'm not crazy!

For Wndows users, remplace:
{L_CODE}:
osSetDynamicTextureDataBlendFace("","vector","PenSize 1;PenColor FFFFFF00;"+cmd,"width:"+(string)resolution+",height:"+(string)resolution+",alpha:0",TRUE,2,0,0,0);
by:
{L_CODE}:
osSetDynamicTextureDataBlendFace("","vector","PenSize 1;PenColor FFFFFF00;"+cmd,"width:"+(string)resolution+",height:"+(string)resolution+",alpha:0",TRUE,2,0,255,0);
Thank you for your great work! :)

PS: Bug repported on mantis #8442

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Mon Jan 07, 2019 7:22 am 

Joined: Mon Jul 19, 2010 3:30 am
Posts: 8
Hey DJ Phil,

Nice find! It may come as no surprise this was written/tested on linux system.

Thanks for sparing people from further crazyness! Gotta love opensim :mrgreen:

I have edited script here to reflect proper value.


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Mon Jan 07, 2019 8:43 am 
OSG Elite
User avatar

Joined: Thu Aug 06, 2009 7:07 am
Posts: 353
Location: B.C. Canada
The script works great. Thanks for that.


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Tue Jan 08, 2019 3:13 pm 

Joined: Mon Jul 19, 2010 3:30 am
Posts: 8
I was scratching my head thinking this could be done better...
Previous version would add a draw command for every 4m of parcel line leading to a large command list for osSetDynamicTextureDataBlendFace(). I was concerned this could become unmanageable for large vars with many parcels. In this version where lines join (be it horizontally or vertically) they are described as one long line leading to a much reduced command list length.

Untested on windows or on large vars with many parcels.

{L_CODE}:
//Sim Parcel Mapping v2
//Total Sorbet Jan 2019


integer resolution=256;        //use power 2 ie..128, 256, 512, 1024 - on higher resolutions it might be useful to change PenSize to something greater than 1
integer timer_chunksize=26;


string cmd;
integer ii1;
integer ii2;
integer hor=-1;
integer ver=-1;
integer pwidth;
integer ppixel;


addline(integer x1,integer y1,integer x2,integer y2)
    {
    cmd+="MoveTo "+(string)(x1*ppixel)+","+(string)((pwidth-y1)*ppixel)+";LineTo "+(string)(x2*ppixel)+","+(string)((pwidth-y2)*ppixel)+";";
    }
   
   
default
    {
    on_rez(integer p){llResetScript();}
    state_entry()
        {
        llSetTexture(osGetMapTexture(),0);
        vector s=osGetRegionSize();
        pwidth=(integer)(s.x/4.0);
        ppixel=resolution/pwidth;
        llSetTimerEvent(0.5);
        }
    timer()
        {
        llSetTimerEvent(0);   
        llResetTime();
        while(ii2<pwidth-1 && llGetTime()<timer_chunksize)
            {
            string h1=llList2String(llGetParcelDetails(<ii1<<2,ii2<<2,0>,[PARCEL_DETAILS_ID]),0); 
            string h2=llList2String(llGetParcelDetails(<ii1<<2,(ii2+1)<<2,0>,[PARCEL_DETAILS_ID]),0);
            string v1=llList2String(llGetParcelDetails(<ii2<<2,ii1<<2,0>,[PARCEL_DETAILS_ID]),0);
            string v2=llList2String(llGetParcelDetails(<(ii2+1)<<2,ii1<<2,0>,[PARCEL_DETAILS_ID]),0);
            if(h1!=h2 && !~hor)hor=ii1;else if (h1==h2 && ~hor){addline(hor,ii2+1,ii1,ii2+1);hor=-1;}
            if(v1!=v2 && !~ver)ver=ii1;else if(v1==v2 && ~ver){addline(ii2+1,ver,ii2+1,ii1);ver=-1;}
            ++ii1;
            if(ii1==pwidth)
                {
                if(~hor)addline(hor,ii2+1,ii1,ii2+1);
                if(~ver)addline(ii2+1,ver,ii2+1,ii1);
                hor=-1;ver=-1;ii1=0;++ii2;
                }
            }
        if(ii2<pwidth-1)llSetTimerEvent(0.5);
        else
            {
            osSetDynamicTextureDataBlendFace("","vector","PenSize 1;PenColor FFFFFF00;"+cmd,"width:"+(string)resolution+",height:"+(string)resolution+",alpha:0",TRUE,2,0,255,0);
            cmd="";
            llSay(0,"done");
            }
        }
    }


Top
 Profile  
 
 Post subject: Re: Parcel Map
PostPosted: Wed Jan 16, 2019 3:49 pm 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 166
Location: Belgium / Brussels
Bug #8442 fixed on Commit d8e5b7 & b2810c :)

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 posts ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net