1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Create Fire Wings

Discussion in 'Development' started by Kyd, Feb 26, 2017.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Hello, what is the best way to create wings with particles?
    Example:
    [​IMG]
     
    jasonwynn10 and JoshXX like this.
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
  3. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    it tried to translate java code (link was in post that you gived me link)
    You can look here :D
    PHP:
    public function drawParticles(Location $location)
    {
        
    $space 0.20;
        
    $defX $location->getX() - ($space shape[0] . l$ength 2) + $space;
        
    $x $defX;
        
    $y $location->getY() + 2.8;
        
    $fire = -(($location->getYaw() + 180) / 60);
        
    $fire += ($location->Yaw() < -180 3.25 2.985);

        for (
    $i 0$i $shape $length$i++) {
            for (
    $j 0$j $shape[i] . $length$j++) {
                if (
    $shape[$i][$j]) {

                    
    $Locationtarget $location->getPosition();
                    
    $Locationtarget->setMotion($y);
                    
    $Locationtarget->setMotion($y);

                    
    $Vectorv $Locationtarget $toVector() . subtract * ($location $toVector());
                    
    $Vectorv2 $getBackVector($location);
                    
    $v $rotateAroundAxisY($v$fire);
                    
    $v->setMotion(0)->multiply(-0.5);

                    
    $location->add(v);
                    
    $location->add(v2);
                    for (
    $k 0$k 3$k++){
                            
    //create particle
             
                    
    }

            }
      

    public static function  
    VectorrotateAroundAxisY(Vector3 $v$fire){
            
    $cos $Math->cos($fire);
            
    $sin $Math->sin($fire);
            
    $x $v->getX() * cos $v->getZ() * $sin;
            
    $z $v->getX() * -sin $v->getZ() * $cos;
            return 
    $v->setX($x)->setZ($z);
        }
    xd
     
  4. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    WTF ?
     
    Sandertv likes this.
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    poor translation
     
    Skullex likes this.
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  7. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Good point, I hadn't noticed that. Besides, maybe this thread will be a little more calm.
    Now, I know extremely little about this complicated math, but I do know a bit about PHP syntax. Variables should(Although I don't think it is necessary) probably start with a lowercase letter, like $variable. $Math appears undefined to me, along with $toVector and $getBackVector. Wouldn't $v->setMotion(0)->multiply(-0.5); keep the motion at 0, since anything multiplied by 0 is still 0? l$ength is probably just a typo, but that also seems undefined. I am probably missing a few things, so feel free to correct me.
     
    Last edited: Feb 27, 2017
  8. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Variable names can be any combination of upper and lower case letters (citation needed), it's all up to your personal preference. I'm sure everyone would prefer people use the common variable naming convention, camelCase, when they post code on the forums but there are no rules/guidelines that say it is mandatory.
     
  9. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    I've seen a few guides that strongly suggest using the common method, but I haven't ever seen a case where doing differently causes issues. Thanks for clearing it up.
     
  10. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I dont know java it is hard to translate for me
     
  11. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Well, this may be advertising, but i am working on a particles plugin which is able to draw wings and properly align them, but at the moment it is a mess and i have limited time to work on it. It will be released, but i just can't find time to finish it.
     
    jasonwynn10 likes this.
  12. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Post it on GitHub, I'll help.
     
  13. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    That would be an interesting idea for customizable elytra wings that work
     
  14. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    The math is finished, just the model system and api around it needs to be done properly.
     
    jasonwynn10 likes this.
  15. SuperXingKong

    SuperXingKong Spider Jockey

    Messages:
    28
    GitHub:
    SuperXingKong
    I am interested in this and may you post it on github?;)
     
    jasonwynn10 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.