Coder Social home page Coder Social logo

java3d-utils's People

Contributors

alessandroborges avatar ctrueden avatar hharrison avatar puybaret avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java3d-utils's Issues

GeometryInfo logic error rise Exception "StripCounts inconsistent with primitive"

Hi!

In GeometryInfo.java we have the following code (lines 2014 to 2025)

    // For stripped primitives, make sure we have strip counts
    //
    if ((prim == TRIANGLE_STRIP_ARRAY) ||
    (prim == TRIANGLE_FAN_ARRAY) ||
    (prim == POLYGON_ARRAY)) {
    if (stripCounts == null) badData = true;
    } else if (stripCounts != null) badData = true;
    if (badData) {
    throw new IllegalArgumentException(
  	  J3dUtilsI18N.getString("GeometryInfo6"));
    }

Please note that line 2020-2021 has a logic error, as it always set badData as true:

    } else if (stripCounts != null) badData = true;

I guess second if should be the following:
} else if (stripCounts.length == 0) badData = true;

scenegraph.io Problem with OrderedGroup

When writing an OrderedGroup that has its index array set to null, j3d throws:
java.lang.NullPointerException
at
com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.OrderedGroupState.writeObject(OrderedGroupState.java:63)

Not sure if this is a bug, as one can always set the array, but considering Null is a legit value regarding the official OrderedGroupState docs, it would be nice if OrderedGroupState could handle an empty index array.

psymagic commented 21 hours ago
After investigating a little further, it really seems like someone forgot to implement io for the case of OrderedGroup.getChildIndexOrder() == null.

Just did a working fix with these lines in com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.OrderedGroupState:

@OverRide
public void writeObject(DataOutput out) throws IOException {
super.writeObject(out);

int[] childIndexOrder = ((OrderedGroup) node).getChildIndexOrder();

if (childIndexOrder == null) {
    out.writeInt(0);
} else {
    out.writeInt(childIndexOrder.length);
    for (int i = 0; i < childIndexOrder.length; i++) {
        out.writeInt(childIndexOrder[i]);
    }
}

}

@OverRide
public void readObject(DataInput in) throws IOException {
super.readObject(in);

int length = in.readInt();
int[] childIndexOrder;

if (length == 0) {
    childIndexOrder = null;
} else {
    childIndexOrder = new int[length];
    for (int i = 0; i < childIndexOrder.length; i++) {
        childIndexOrder[i] = in.readInt();
    }
}
((OrderedGroup) node).setChildIndexOrder(childIndexOrder);

}
It might not be perfect thou.

Java 11 Compatibility check: java3d-utils

Hi,
In our system we are using old version of library j3dutils(version 1.5) and we are reaching out to you to check Java 11 compatibility of yours library: java3d-utils.

Could you help us by answering the following questions:

  1. Can your library replace the old library j3dutils founded by Sun Microsystems.

If yes please give us information about your library: java3d-utils.

  1. Library Name:
  2. Latest version: <latest 1.1.1="" eg:="" version.="">
  3. Latest version Is the library compatible with Java 11 Compatible? (Y/N)
  4. Is the library supported with Java 11? (Y/N)
  5. (If โ€œNโ€ in compatibility or support) What is the versions that would be compatible and Supported?
  6. Date of support availability?

Appreciate your response by 06.09.2018.

Thanks,
Krzysztof Dragan,
PTC Inc. Contractor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.