# fluoriioni

Member Since 22 Dec 2009
Offline Last Active Apr 03 2013 06:36 AM

### Orbiting gravity

12 January 2013 - 01:54 AM

I have been trying to make system that would support orbiting around a planetary body, but all my solutions have been very wiggly and unstable. So, how should i go about implementing this system?

This is how my system was written:

```grav=vak_y*((mass*bodymass)/dbp(phy_position_x,phy_position_y,earth.phy_position_x,earth.phy_position_y))
angle=point_direction(phy_position_x,phy_position_y,earth.phy_position_x,earth.phy_position_y)
if angle>angle-90 {angle=angle-90}
if angle>angle-180 {angle=angle-180}
if angle>angle-270 {angle=angle-270}
physics_apply_force(phy_position_x,phy_position_y,xforce,yforce)
```

and this is the script dbp

```//dbp(x1,y1,x2,y2)

var localvar1, localvar2, localvar3;

localvar1=abs(argument0-argument2)
localvar2=abs(argument1-argument3)
localvar3 = sqrt((localvar1^2)+(localvar2^2))
if localvar3=0 {lockalvar3+=0.001}
return localvar3
```
i do not need ready code, i just need ideas how i should go about trying to count the x and y components of the gravitational force.

### 2d-to-3d script problems

12 December 2012 - 03:25 PM

Hi! I am having strange problems with using 2d-to-3d scripts.

The soldier object should count its position on the screen utilizing convert_3d script, but the results i get for x_2d and y_2d are very strange.
```convert_prepare(kamera.x,kamera.y,kamera.z ,kamera.x + kamera.camxt, kamera.y + kamera.camyt, kamera.z + kamera.camzt, 0,0,1, kamera.fole, kamera.disp_asp)
convert_3d(x,y,0,kamera.x, kamera.y, kamera.z,0)
```
This is the code i use on soldier object. Kamera is the name of camera object

```d3d_set_projection_ext(x,y,z , x + camxt, y + camyt, z + camzt, 0,0,1, fole, disp_asp, 1, 10000);
```
This is the code i set project with. Is there any mistake i have made because this is killing my project.

If there is nothing to do with those scripts, there is the .gmk

Please do not steal all of my assets.

The object trying to do convert_3d is soldier and camera object is kamera.

I know this is an bubblegum solution, but i got it working by dividing the angle by 2.5

Anyone has any idea why this would be?

### transformation problem

10 December 2012 - 07:30 PM

```d3d_transform_set_identity()
d3d_transform_set_translation(x,y,0)

d3d_model_draw(global.soldier_animation[1,frame],0,0,0,-1)

d3d_transform_set_identity()
```

Hello. I am making my game and i have very strange problem with this code.

The problem is, that when i draw this, it totally ignores all transforms and just draws the model without them.

And btw, xnum and ynum do change. It is not so simple solution.

### Bloom

28 July 2012 - 06:39 PM

I am asking how should i go about doing this and what might be the most efficient and best option to make this.
I know well GML so i dont need complete idiot's explain but if you really want to, go ahead.

So, what is the fastest way of doing bloom and what is the best looking? (or what is fast and best)

Thank you
-fluo

### Specularity tutorial

16 July 2012 - 12:06 PM

I searched for some good specular engines on GMC and found out that there are none (atleast for me to find).
That is why i created this engine that is simple yet looks pretty professional.

In my engine you use specular textures to control which parts are shining and which are not.

The engine works by drawing everything second time with the specular map and using additive blend modes.
This makes it possible to have specular detail on any model or shape.
To control which parts of the level has the effect, you must add lights to the specular render.