Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005761opensim[REGION] Script Functionspublic2011-10-28 17:342013-05-18 22:41
ReporterGuduleLapointe 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0005761: Texture rotation get strange values with llSetPrimitiveParams
DescriptionWhen I try to set a texture rotation of PI (180°), it becomes -179.66 or -179.22 or values like that, never 180°. Strangely, if I set it to -PI (minus PI), it becomes -179.99 but still not 180.

Code is imported from a script I made in Second Life (where it gives correct value) and is quite big, but here is the simplified command:

        llSetPrimitiveParams([
            PRIM_TEXTURE, sideTitle, "!Combo-title",
                <1, 1, 0>,<0, 0, 0>,PI
            ]);

The full code is more complex, and this is the reason I use llSetPrimitiveParams

Attached is an iar with the box and the textures used for the text
Additional InformationThe actual code changes all sides with a variety of settings for each one, and when using it, the value is still different, but again, only for the side where I wanted "PI" / 180° rotation.

integer sideTitle = 4;
vector black = <0,0,0>;
vector white = <1,1,1>;
vector colorReset = <0.25,0.25,0.25>;
integer sidePicture = 0;
integer sideStatus = 2;
integer sideStatusOffset = 0;
float statusLines = 24;

default
{
    state_entry()
    {
        llSetPrimitiveParams([
            PRIM_TYPE, 0,0,<0, 1, 0>,0,<0, 0, 0>,<0.75, 1, 0>,<0, 0, 0>,
            PRIM_TEXTURE, ALL_SIDES, "5748decc-f629-461c-9a36-a35a221fe21f",
                <1, 1, 0>,<0, 0, 0>,0,
            PRIM_COLOR, ALL_SIDES, black, 1,
            PRIM_FULLBRIGHT, ALL_SIDES, TRUE,
            PRIM_BUMP_SHINY, ALL_SIDES, PRIM_SHINY_NONE, PRIM_BUMP_NONE,
            PRIM_TEXTURE, sideTitle, "!Combo-title",
                <1, 1, 0>,<0, 0, 0>,PI,
            PRIM_COLOR, sideTitle, colorReset, 1,
            PRIM_TEXTURE, sideStatus, "!Combo-status",
                <1, 1/statusLines, 0>,
                <0, ((statusLines / 2) - 0.5 - 0) / statusLines,
                     0>,0,
            PRIM_COLOR, sideStatus, colorReset, 1,
            PRIM_BUMP_SHINY, sidePicture, PRIM_SHINY_LOW, PRIM_BUMP_NONE,
            PRIM_TEXTURE, sidePicture, "!Combo-rent",
                <0.99, 0.99, 0>,<0, 0, 0>,PI_BY_TWO,
            PRIM_COLOR, sidePicture, white, 1
            ]);
    }
}


TagsNo tags attached.
Git Revision or version number272bf71 r17041 2011-10-27 02:26:37 -0700
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBasicPhysics
Script Engine
EnvironmentMono / Linux64
Mono Version2.6.3
ViewerSingularity
Attached Files? file icon rotation-test.iar [^] (191,482 bytes) 2011-10-28 17:34
? file icon primtexture.lsl [^] (3,206 bytes) 2013-05-18 22:40

- Relationships

-  Notes
(0023909)
Allen Kerensky (reporter)
2013-05-18 22:41
edited on: 2013-05-18 22:43

Add another test case and additional output to this existing Mantis.

Setting texture rotation on each face of a prim gives odd values that do not match a float rotation_in_radians that I would expect to see.

Additional test shows that SecondLife servers do something different yet equally weird.

Test script "primtexture.lsl" attached.

Just drop in a plywood cube prim and it will setup and run - sample runs with weird data are in the script comments.

This may all be simply a difference between how OS and SL handle floats internally... but nothing stuck out as obvious to me after a look at LSL_Float struct and LSL_Api.cs implementation of llSetPrimitiveParams


- Issue History
Date Modified Username Field Change
2011-10-28 17:34 GuduleLapointe New Issue
2011-10-28 17:34 GuduleLapointe File Added: rotation-test.iar
2011-10-28 17:34 GuduleLapointe Git Revision => 272bf71 r17041 2011-10-27 02:26:37 -0700
2011-10-28 17:34 GuduleLapointe Run Mode => Standalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
2011-10-28 17:34 GuduleLapointe Physics Engine => BasicPhysics
2011-10-28 17:34 GuduleLapointe Environment => Mono / Linux64
2011-10-28 17:34 GuduleLapointe Mono Version => 2.6.3
2011-10-28 17:34 GuduleLapointe Viewer => Singularity
2013-05-18 22:40 Allen Kerensky File Added: primtexture.lsl
2013-05-18 22:41 Allen Kerensky Note Added: 0023909
2013-05-18 22:43 Allen Kerensky Note Edited: 0023909 View Revisions


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker