All Downloads are FREE. Search and download functionalities are using the official Maven repository.

one.empty3.library.core.tribase.PointWire Maven / Gradle / Ivy

Go to download

3D rendering engine. Plus modelling. Expected glsl textures 3d and 2d rendering3D primitives, and a lot of scenes' samples to test.+ Game Jogl reworked, Calculator (numbers and vectors). Java code parser implementation starts (<=1.2)

The newest version!
/*
 *
 *  * Copyright (c) 2024. Manuel Daniel Dahmen
 *  *
 *  *
 *  *    Copyright 2024 Manuel Daniel Dahmen
 *  *
 *  *    Licensed under the Apache License, Version 2.0 (the "License");
 *  *    you may not use this file except in compliance with the License.
 *  *    You may obtain a copy of the License at
 *  *
 *  *        http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  *    Unless required by applicable law or agreed to in writing, software
 *  *    distributed under the License is distributed on an "AS IS" BASIS,
 *  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  *    See the License for the specific language governing permissions and
 *  *    limitations under the License.
 *
 *
 */

/*

 Vous êtes libre de :

 */
package one.empty3.library.core.tribase;

import one.empty3.library.*;

import java.util.ArrayList;

public class PointWire extends Representable implements IFct1D3D {

    private String id;

    private ArrayList beziers;

    public PointWire(ArrayList base) {
        beziers = new ArrayList();

        base.add(0, base.get(0));
        base.add(base.get(base.size() - 1));

        for (int i = 0; i < base.size() - 1; i++) {

            BezierCubique bc = new BezierCubique();

            bc.add(base.get(i).plus(base.get(i + 1)).mult(0.5));
            bc.add(base.get(i + 1));
            bc.add(base.get(i + 1));
            bc.add(base.get(i + 1).plus(base.get(i + 2)).mult(0.1));

            beziers.add(bc);

        }
    }

    @Override
    public int iteres() {
        return 1000;
    }

    public double maxValue() {
        return beziers.size();
    }

    public Point3D normale(double t) {
        return tangente(t + 0.00001).plus(tangente(t).mult(-1d));
    }

    public Representable place(MODObjet aThis) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Barycentre position() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }


    @Override
    public boolean supporteTexture() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Point3D tangente(double t) {
        return beziers
                .get((int) (0.0001 + t))
                .calculerPoint3D((0.0000001 + t) - (int) (0.0001 + t))
                .plus(beziers.get((int) t).calculerPoint3D(t - (int) t)
                        .mult(-1d));
    }

    public TextureCol texture() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Point3D value(double t) {
        return beziers.get((int) t).calculerPoint3D(t - (int) t);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy