public override void initialize() { List <EntityBase> objs = m_scene.GetEntities(); lock (objs) { try { foreach (EntityBase obj in objs) { if (obj is SceneObjectGroup) { SceneObjectGroup mapdot = (SceneObjectGroup)obj; foreach (SceneObjectPart part in mapdot.Children.Values) { if (part == null) { continue; } LLVector3CL position = Utility.toLLVector3(part.GroupPosition); LLQuaternionCL rotation = Utility.toLLQuaternion(part.RotationOffset); LLVector3CL scale = Utility.toLLVector3(part.Scale); PrimitiveBaseShape shape = part.Shape; LLPathParamsCL pathParams = new LLPathParamsCL(shape.PathCurve, shape.PathBegin, shape.PathEnd, shape.PathScaleX, shape.PathScaleY, shape.PathShearX, shape.PathShearY, shape.PathTwist, shape.PathTwistBegin, shape.PathRadiusOffset, shape.PathTaperX, shape.PathTaperY, shape.PathRevolutions, shape.PathSkew); LLProfileParamsCL profileParams = new LLProfileParamsCL(shape.ProfileCurve, shape.ProfileBegin, shape.ProfileEnd, shape.ProfileHollow); LLVolumeParamsCL volumeParams = new LLVolumeParamsCL(profileParams, pathParams); int facenum = part.GetNumberOfSides(); List <SimpleColorCL> colors = new List <SimpleColorCL>(); for (uint j = 0; j < facenum; j++) { TextureColorModel data = Utility.GetDataFromFile(shape.Textures.GetFace(j).TextureID.ToString()); colors.Add(new SimpleColorCL(data.A, data.R, data.G, data.B)); } m_primitiveList.Add(new PrimitiveCL(volumeParams, position, rotation, scale, colors.ToArray(), facenum)); } } } } catch (Exception e) { m_log.ErrorFormat("[WebMapService]: Initialize object layer failed with {0} {1}", e.Message, e.StackTrace); } } }
public override Bitmap render(BBox bbox, int width, int height, int elevation) { LLVector3CL[] pos = new LLVector3CL[m_volumeCount]; LLVector3CL[] sca = new LLVector3CL[m_volumeCount]; LLQuaternionCL[] rot = new LLQuaternionCL[m_volumeCount]; LLVolumeParamsCL[] vop = new LLVolumeParamsCL[m_volumeCount]; TextureEntryListCL[] tel = new TextureEntryListCL[m_volumeCount]; for (int i = 0; i < m_volumeCount; i++) { pos[i] = m_positions[i]; sca[i] = m_scales[i]; rot[i] = m_rotations[i]; vop[i] = m_volumeParams[i]; tel[i] = m_textureEntryLists[i]; } MapRenderCL mr = new MapRenderCL(); string regionID = m_scene.RegionInfo.RegionID.ToString(); mr.mapRender( regionID, bbox.MinX, bbox.MinY, 0, bbox.MaxX, bbox.MaxY, (float)elevation, vop, m_volumeCount, pos, rot, sca, tel, width, height, "e:\\\\MonoImage\\\\", "e:\\\\regionMap\\\\"); Bitmap bmp = new Bitmap("e:\\\\regionMap\\\\" + regionID + ".bmp"); bmp.MakeTransparent(Color.FromArgb(0, 0, 0, 0)); return(bmp); }
public override Bitmap render(BBox bbox, int width, int height, int elevation) { LLVector3CL[] pos = new LLVector3CL[m_volumeCount]; LLVector3CL[] sca = new LLVector3CL[m_volumeCount]; LLQuaternionCL[] rot = new LLQuaternionCL[m_volumeCount]; LLVolumeParamsCL[] vop = new LLVolumeParamsCL[m_volumeCount]; TextureEntryListCL[] tel = new TextureEntryListCL[m_volumeCount]; for (int i = 0; i < m_volumeCount; i++) { pos[i] = m_positions[i]; sca[i] = m_scales[i]; rot[i] = m_rotations[i]; vop[i] = m_volumeParams[i]; tel[i] = m_textureEntryLists[i]; } MapRenderCL mr = new MapRenderCL(); string regionID = m_scene.RegionInfo.RegionID.ToString(); mr.mapRender( regionID, bbox.MinX, bbox.MinY, 0, bbox.MaxX, bbox.MaxY, (float)elevation, vop, m_volumeCount, pos, rot, sca, tel, width, height, "e:\\\\MonoImage\\\\", "e:\\\\regionMap\\\\"); Bitmap bmp = new Bitmap("e:\\\\regionMap\\\\" + regionID + ".bmp"); bmp.MakeTransparent(Color.FromArgb(0, 0, 0, 0)); return bmp; }