Can you hide the stem in view 2.5d extension?

@aaaronb I guess you are the best person to answer this, but one student asked me this question and I couldn’t find an answer from the documentation. I tried to set the stem size to 0 but there is still a black line holding the turtle; I tried to set the color to [0 0 0 0] but it does not support RGBA (which is probably a bug).

@aaaronb Any thoughts on this?

Hi John,
Unfortunately there is no way to do that at this time.
I tried the approach of making a transparent turtle and giving the stem the color of the turtle, but it caused a run-time error.

The code would require a number of changes in order to handle alpha, and I don’t think that is a priority at this time.
You can make an enhancement request

The code is written with RGB colors only in mind.

Among the places that would need to be changed
extensions/view2.5d/src/main/java/view25d/view/TurtleView.java
double stemColor = getStemColor(context, turtle);

The stem color is stored as a double.
The turtle color is stored as a Java Color, but I think the alpha values is not used.
extensions/view2.5d/src/main/java/view25d/view/TurtleValue.java

public TurtleValue( String sh, Color co, double sz,
                    double x, double y, double val, double stc) {
	this.shape = sh;
	this.color = co;
	this.xcor = x;
	this.ycor = y;
	this.size = sz;
	this.reporterValue = val;
	this.stemColor = stc;
}

the graphics is done in extensions/view2.5d/src/main/java/view25d/view/gl/TurtleGL.java

and there only red, blue and green are extracted from colors

        double stemColor = tv.stemColor;
        Color c = org.nlogo.api.Color.getColor(stemColor);
        float stemRed = c.getRed() / 255f;
        float stemGreen = c.getGreen() / 255f;
        float stemBlue = c.getBlue() / 255f;
        setColorAndStandardMaterial( gl, stemRed, stemGreen, stemBlue );
1 Like