Raised This Month: $32 Target: $400
 8% 

Multiple BeamRingPoints


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Minfas
Member
Join Date: Dec 2017
Old 08-10-2019 , 17:07   Multiple BeamRingPoints
Reply With Quote #1

Hello community,
Is there any way to create multiple TE_SetupBeamRingPoint above each other?

My Code:
Spoiler


What I want is create something like cone from circles.
Thanks for any help!
Minfas is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 08-10-2019 , 18:40   Re: Multiple BeamRingPoints
Reply With Quote #2

You can do it of course, however you'll have to do something like this:
PHP Code:
        float pos[3];
        
pos[0] = g_fMakerPos[marker][0];
        
pos[1] = g_fMakerPos[marker][1];
        
pos[2] = g_fMakerPos[marker][2];

        
TE_SetupBeamRingPoint(pos150.0150.0+0.1g_iBeamSpriteg_iHaloSprite0101.01.20.0colors100); 
        
TE_SendToAll();

        
pos[2] += 10.0

        TE_SetupBeamRingPoint
(pos100.0100.0+0.1g_iBeamSpriteg_iHaloSprite0101.01.20.0colors100); 
        
TE_SendToAll();

        
pos[2] += 10.0

        TE_SetupBeamRingPoint
(pos75.075.0+0.1g_iBeamSpriteg_iHaloSprite0101.01.20.0colors100); 
        
TE_SendToAll();

        
etc........... 

Notice that the ring ending point is changing each time too, this is just to say...

You can use a linear relation between the variation z and radius r (there's only two constant "a" and "b" between them, and you can give it a value of your needs).

Like:
Code:
    r(z) = a * z + b

    a = delta r / delta z
    b = r(0)
Example: let's reuse the previous code

Our cone is going to start from Z = 0.0 to Z = 100.0; and R changes from 0 to 150 so a = (150 - 0) / (0.0 - 100.0) = -1.5; b = r(z = 0) = 150.0 so that r = -1.5z + 150.0

PHP Code:
        float pos[3];
        
pos[0] = g_fMakerPos[marker][0];
        
pos[1] = g_fMakerPos[marker][1];
        
pos[2] = g_fMakerPos[marker][2];

        
float z 0.00.0;

        while( 
100.0f )
        {
                
+= 20.0;
                
pos[2] += z;
                
= -1.5 150.0;
                
                
TE_SetupBeamRingPoint(posrr+0.1g_iBeamSpriteg_iHaloSprite0101.01.20.0colors100); 
                
TE_SendToAll(); 
        } 

Last edited by TheDS1337; 08-10-2019 at 19:01.
TheDS1337 is offline
Minfas
Member
Join Date: Dec 2017
Old 08-11-2019 , 08:19   Re: Multiple BeamRingPoints
Reply With Quote #3

It's working.
Thank you for your help!
Minfas is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode