Oct 3rd, 2005, 02:23 PM
#1
Last edited by Jacob Roman; Feb 15th, 2006 at 07:26 PM .
Oct 9th, 2005, 10:57 AM
#2
Nov 18th, 2005, 02:43 AM
#3
Hyperactive Member
Re: Need this
If you want to be banned just go away send a PM to a mod to ask and stop spamming the Forums...
506C65617365205261746520506F7374732E2E2E
Nov 18th, 2005, 09:41 AM
#4
Re: Need this
That's for later on incase VBForums ends up making me fat again.
Nov 22nd, 2005, 04:39 AM
#5
Fanatic Member
Dec 8th, 2005, 08:22 PM
#6
Re: Need this
Attached Images
Dec 8th, 2005, 08:51 PM
#7
Dec 10th, 2005, 07:06 PM
#8
Fanatic Member
Re: Need this
You need a lot of things don't you?
Dec 10th, 2005, 07:34 PM
#9
Re: Need this
Like the love of a good woman...
Dec 11th, 2005, 10:33 PM
#10
Re: Need this
Originally Posted by
thegreatone
Like the love of a good woman...
Already get that every night. I love my Jasmine.
Dec 14th, 2005, 07:14 PM
#11
Re: Need this
Originally Posted by
Jacob Roman
Already get that every night. I love my Jasmine.
Good on yer.
Dec 19th, 2005, 07:57 PM
#12
Re: Need this
Need this too
Attached Files
Last edited by Jacob Roman; Dec 19th, 2005 at 08:14 PM .
Dec 23rd, 2005, 07:12 AM
#13
Re: Need this
That interleaved code of yours, all your modules must have double of the amount of lines needed, and the screen shows the same its shown with normal code in a 640x480 resolution.
Dec 25th, 2005, 02:18 PM
#14
Re: Need this
Originally Posted by
jcis
That interleaved code of yours, all your modules must have double of the amount of lines needed, and the screen shows the same its shown with normal code in a 640x480 resolution.
Huh?
Jan 2nd, 2006, 05:09 PM
#15
Re: Need this
and now I need this... don't hate me for it...
Last edited by timeshifter; Jan 2nd, 2006 at 05:15 PM .
Jan 2nd, 2006, 10:49 PM
#16
Jan 3rd, 2006, 12:44 PM
#17
Jan 10th, 2006, 06:41 PM
#18
Jan 12th, 2006, 04:52 PM
#19
Re: Need this
Physics! How can I not need em!
Attached Files
Jan 13th, 2006, 01:03 AM
#20
Re: Need this
Just incase I'm not able to get on this computer
Attached Files
Last edited by Jacob Roman; Jan 13th, 2006 at 02:02 AM .
Jan 15th, 2006, 11:44 PM
#21
Re: Need this
Working and (sorta complete) Tile Engine I wrote!!!
DXTut - Tile Engine.zip
Other DX 2D tutorials I must cover:
Quadtrees
Time Based Movement
Scrolling Backgrounds
Sprite Layers
Animation States
Clipping
Rotation
Scaling
Filling Modes
Multitexturing
Last edited by Jacob Roman; Jan 17th, 2006 at 12:26 PM .
Jan 17th, 2006, 12:39 PM
#22
Re: Need this
VB Code:
For Y = 0 To Map_Height
For X = 0 To Map_Width
If Clip_Polygon(Vertex_List(I + 0), Vertex_List(I + 4)) = False Then
X2 = X2 + 1
If Temp <> Y Then
Temp = Y
Y2 = Y2 + 1
End If
New_Tile(X2 - 1,Y2 - 1) = Tile(X,Y)
End If
I = I + Number_Of_Vertices_Per_Quad
End If
Next X
Next Y
Last edited by Jacob Roman; Jan 17th, 2006 at 03:20 PM .
Jan 18th, 2006, 06:41 AM
#23
Re: Need this
If you want more smilies you can always post them in the Fx Extension thread...and I will add them next time...
Jan 18th, 2006, 09:37 AM
#24
Re: Need this
The ban plz smilie and w00t! smilie should definitely be added
Jan 19th, 2006, 11:49 AM
#25
Jan 25th, 2006, 03:20 PM
#26
Re: Need this
Attached Images
Jan 25th, 2006, 09:58 PM
#27
Re: Need this
Attached Files
Jan 26th, 2006, 08:37 PM
#28
Re: Need this
Quake 4 physics from the SDK
Attached Files
Jan 26th, 2006, 08:42 PM
#29
Hyperactive Member
Re: Need this
quake 3 would make a nice virtual world.
Feb 8th, 2006, 03:29 PM
#30
Re: Need this
Forward Euler
Backward Euler
Symplectic Euler
Explicit Euler
Inplicit Euler
Verlet
Time Corrected Verlet
Runge Kutta 2
Runge Kutta 4
Runge Kutta 6
Newton Stormer Verlet
Euler-Verlet Variant
Feynman
Feb 8th, 2006, 03:32 PM
#31
Re: Need this
FridgeCutter 3D
Feb 8th, 2006, 05:44 PM
#32
Re: Need this
Code:
//-----------------------------------------------------------------------------
//
// heat1d_simple.cpp
// Simulates the 1D Heat Equation by Forward (Explicit) Euler Method
// in the case of constant Dirichlet BCs.
//
// * The number of grid points (nj+1) is fixed at compile time.
// * Boundary values are fixed by initial conditions and do not change.
//
//-----------------------------------------------------------------------------
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
// Global variables
// ----------------
const double pi = 3.14159265358979323846;
const int nj = 100; // Number of spatial grid points = nj + 1
// Function prototypes
// -------------------
void Step_fe (double U[], const double dt, const double dx);
//===========================================================================//
int main (void)
{
int nsteps;
double U[nj + 1], dt, dx, t_f, length;
// Set and write problem parameters
// --------------------------------
cout << "Enter length, final time, number of time steps" << endl;
cin >> length >> t_f >> nsteps;
dt = t_f / nsteps;
dx = length / nj;
cout << endl << "Parameters: \n";
cout << " nj = " << nj << "\t"
<< " length = " << length << "\t" << " dx = " << dx << endl;
cout << " nsteps = " << nsteps << "\t"
<< " t_f = " << t_f << "\t" << " dt = " << dt << endl;
cout << " nu = " << dt / (dx * dx) << endl << endl;
// Set initial conditions
// ----------------------
// Two initial conditions are given:
// U(x) = x + sin(4 pi x) + 2 sin(9 pi x)
// U(x) = 4 * x * ( 1 - x )
// uncomment as desired.
for (int j = 0; j <= nj; j++)
{
U[j] = j * dx + sin (4. * pi * j * dx) + 2. * sin (9. * pi * j * dx);
// 4. * j * dx * (1. - j * dx);
}
// Main time stepping loop
// -----------------------
for (int time_step = 0; time_step < nsteps; time_step++)
{
Step_fe (U, dt, dx);
}
// Write final results to a file
// -----------------------------
ofstream fout ("heat1d.txt");
for (int j = 0; j <= nj; j++)
{
fout << j << "\t" << U[j] << endl;
}
return 0;
}
//===========================================================================//
void Step_fe (double U[], const double dt, const double dx)
{
// Function for taking one Forward-Euler time-step. For all
// interior grid points, it replaces U[j] with U[j] at the next time
// step. Values at the boundaries j=0 and j=nj are unchanged. The
// array A_plus_on_U is necessary for temporary storage.
const double nu = dt / (dx * dx);
double A_plus_on_U[nj + 1];
for (int j = 1; j < nj; j++)
{
A_plus_on_U[j] = U[j] + nu * (U[j - 1] - 2. * U[j] + U[j + 1]);
}
for (int j = 1; j < nj; j++)
{
U[j] = A_plus_on_U[j];
}
}
//===========================================================================//
Feb 8th, 2006, 05:50 PM
#33
Re: Need this
Explicit methods calculate the state of a system at next instance in time using the state of the system at the current time, while an implicit method finds it by solving an equation involving both the current system state and the future one.
Feb 8th, 2006, 05:51 PM
#34
Re: Need this
Originally Posted by
Jacob Roman
Explicit methods calculate the state of a system at next instance in time using the state of the system at the current time, while an implicit method finds it by solving an equation involving both the current system state and the future one.
Feb 9th, 2006, 09:43 AM
#35
Re: Need this
Time Step Integration Methods
x - Position
v - Velocity
a - Acceleration
dt - Delta Time
x0 - Initial Position
v0 - Initial Velocity
Euler Integration:
x = x0 + v * dt
v = v0 + a * dt
Velocity-less Verlet:
v = x - old_x + a * dt * dt
x = x0 + v
old_x = x
Time Corrected Velocity-less Verlet
v = x + (x - old_x) * (dt / old_dt) + a * dt * dt
x = x0 + v
old_x = x
old_dt = dt
Prescaled Euler
v = v0 + a * dt * dt
x = x0 + v
Re-ordered traditional Euler, AKA "Semi-implicit" Euler):
v = v0 + a * dt
x = x0 + v * dt
http://www.msu.edu/~brechtjo/physics.../netForce.html
http://www.devmaster.net/wiki/Integration_methods
http://xbeams.chem.yale.edu/~batista/vaa/node60.html
http://www.openmp.org/samples/md.html
http://www.compsoc.man.ac.uk/~lucky/...ry/verlet.html
http://www.cs.unc.edu/~coombe/comp259/hw1/
A must see, with code samples!!!
http://www.ph.ed.ac.uk/~graeme/compmeth/verlet.html
Still trying the LeapFrog
http://www.artcompsci.org/vol_1/v1_web/node35.html
'h - step size
'y - position
'y0 - initial position
't0 - intial time
'f() - function
'Euler: y'(t) = f(y(t),t) y(t0) = y0
'Forward Euler (Explicit): y(t+1) = y(t) + h * f(y(t),t)
'Backward Euler (Implicit): y(t+1) = y(t) + h * f(y(t + 1),t + 1)
Last edited by Jacob Roman; Feb 16th, 2006 at 02:02 PM .
Feb 17th, 2006, 02:18 PM
#36
Re: Need this
Code:
struct Test {
Test() {
int count = 100;
flt x = 0.f;
flt v = 0.f;
flt a = 9.81f;
flt dt = 1.f/flt(count);
int i;
lprintf("Simple Euler:\n");
for (i=0; i < count; i++) {
x += v*dt;
v += a*dt;
lprintf("V: %f X: %f\n",v,x);
} // for
x = v = 0.f;
lprintf("More Accurate Euler:\n");
for (i=0; i < count; i++) {
x += v*dt + .5f*a*dt*dt;
v += a*dt;
lprintf("V: %f X: %f\n",v,x);
} // for
x = v = 0.f;
lprintf("NSV: Newton-Stormer-Verlet ('Semi-implicit' Euler):\n");
for (i=0; i < count; i++) {
v += a*dt;
x += v*dt;
lprintf("V: %f X: %f\n",v,x);
} // for
lprintf("Velocity-less Verlet:\n");
flt xc = 0.f;
flt xo = xc;
for (i=0; i < count; i++) {
v = xc - xo + a*dt*dt;
xo = xc;
xc += v;
lprintf("V: %f X: %f\n",v/dt,xc);
} // for
lprintf("My NSV variant\n");
x = v = 0.f;
flt dt2 = dt*dt;
for (i=0; i < count; i++) {
v += a*dt2;
x += v; // v is prescaled: really a displacement.
lprintf("V: %f X: %f\n",v/dt,x);
} // for
lprintf("Velocity Verlet variant\n");
flt oldAccel = a; //0.f; // May be self-starting issues...
x = v = 0.f;
for (i=0; i < count; i++) {
x += v*dt + .5f*oldAccel*dt*dt;
v += .5f*(oldAccel+a)*dt;
oldAccel = a;
lprintf("V: %f X: %f\n",v,x);
} // for
}
} test;
VB Code:
Option Explicit
Dim dt As Single
Private Sub Timer1_Timer()
Dim k1 As Single, k2 As Single, k3 As Single, k4 As Single
Dim l1 As Single, l2 As Single, l3 As Single, l4 As Single
Dim x As Single, v As Single, a As Single
Dim xnew As Single, vnew As Single
Dim f As Single, m As Single
Dim x0 As Single, v0 As Single
ScaleMode = 3
AutoRedraw = True
DrawWidth = 10
f = 5
m = 5
v = 1
a = f / m
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
k3 = dt * (v + k2 / 2)
l3 = dt * a
k4 = dt * (v + k3)
l4 = dt * a
xnew = x + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6
vnew = v + l1 / 6 + l2 / 3 + l3 / 3 + l4 / 6
Cls
PSet (xnew, 100)
Caption = xnew & " " & vnew
dt = dt + 0.1
End Sub
Last edited by Jacob Roman; Feb 21st, 2006 at 06:30 AM .
Feb 22nd, 2006, 06:27 AM
#37
Re: Need this
http://www.gamedev.net/community/for...opic_id=374930
Post #14
VB Code:
Option Explicit
Private Sub Form_Activate()
AutoRedraw = True
Dim k1 As Single, k2 As Single, k3 As Single, k4 As Single
Dim l1 As Single, l2 As Single, l3 As Single, l4 As Single
Dim x As Single, x0 As Single, v As Single, f As Single
Dim a As Single, dt As Single, v0 As Single, m As Single
v0 = 1
a = 0
List1.AddItem "Euler Integration"
List1.AddItem "---------------------"
For dt = 0 To 10 Step 0.5
x = x0 + v * dt
v = v0 + a * dt
List1.AddItem "X: " & x & " " & "V: " & v
Next dt
List1.AddItem ""
List1.AddItem "RK4 Integration"
List1.AddItem "---------------------"
f = 0
m = 1
v0 = 1
a = f / m
For dt = 0 To 10 Step 0.5
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
k3 = dt * (v + k2 / 2)
l3 = dt * a
k4 = dt * (v + k3)
l4 = dt * a
x = x0 + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6
v = v0 + l1 / 6 + l2 / 3 + l3 / 3 + l4 / 6
List1.AddItem "X: " & x & " " & "V: " & v
Next dt
End Sub
Last edited by Jacob Roman; Feb 22nd, 2006 at 09:42 AM .
Feb 22nd, 2006, 05:42 PM
#38
Re: Need this
VB Code:
Option Explicit
Private Sub Main()
Dim S As String, S2 As String, S3 As String, S4 As String
Dim k1 As Single, k2 As Single, k3 As Single, k4 As Single
Dim l1 As Single, l2 As Single, l3 As Single, l4 As Single
Dim x As Single, x0 As Single, v As Single, f As Single
Dim xc As Single
Dim a As Single, dt As Single, dt2 As Single, v0 As Single, m As Single
Dim i As Long
Dim Old_A As Single
a = 9.8
dt = 1 / 10
x = 0
v = 0
'S = S & "" & vbCrLf
S = S & "Euler Integration" & vbCrLf
S = S & "---------------------" & vbCrLf
For i = 0 To 9
x = x + v * dt
v = v + a * dt
S = S & "X: " & x & " " & "V: " & v & vbCrLf
Next i
x = 0
v = 0
S = S & "" & vbCrLf
S = S & "2nd Order Euler Integration" & vbCrLf
S = S & "---------------------" & vbCrLf
For i = 0 To 9
x = x + v * dt + 0.5 * a * dt * dt
v = v + a * dt
S = S & "X: " & x & " " & "V: " & v & vbCrLf
Next i
x = 0
v = 0
S2 = S2 & "" & vbCrLf
S2 = S2 & "Newton Stormer Verlet (Semi Implicit Euler)" & vbCrLf
S2 = S2 & "---------------------" & vbCrLf
For i = 0 To 9
v = v + a * dt
x = x + v * dt
S2 = S2 & "X: " & x & " " & "V: " & v & vbCrLf
Next i
x = 0
v = 0
S2 = S2 & "" & vbCrLf
S2 = S2 & "Velocity-less Verlet Integration" & vbCrLf
S2 = S2 & "---------------------" & vbCrLf
For i = 0 To 9
v = x - x0 + a * dt * dt
x0 = x
x = x + v
S2 = S2 & "X: " & x & " " & "V: " & v / dt & vbCrLf
Next i
x = 0
v = 0
dt2 = dt * dt
S3 = S3 & "" & vbCrLf
S3 = S3 & "NSV Variant Integration" & vbCrLf
S3 = S3 & "---------------------" & vbCrLf
For i = 0 To 9
v = v + a * dt2
x = x + v
S3 = S3 & "X: " & x & " " & "V: " & v / dt & vbCrLf
Next i
x = 0
v = 0
'FIX THIS
'/////////////////////////////////////////////////////////////
S3 = S3 & "" & vbCrLf
S3 = S3 & "Velocity Verlet Integration" & vbCrLf
S3 = S3 & "---------------------" & vbCrLf
Old_A = a
For i = 0 To 9
x = x + v * dt + 0.5 * Old_A * dt * dt
v = v + 0.5 * (Old_A + a) * dt
S3 = S3 & "X: " & x & " " & "V: " & v / dt & vbCrLf
Next i
'/////////////////////////////////////////////////////////////
S4 = S4 & "" & vbCrLf
S4 = S4 & "RK4 Integration" & vbCrLf
S4 = S4 & "---------------------" & vbCrLf
x = 0
v = 0
For i = 0 To 9
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
k3 = dt * (v + k2 / 2)
l3 = dt * a
k4 = dt * (v + k3)
l4 = dt * a
x = x + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6
v = v + l1 / 6 + l2 / 3 + l3 / 3 + l4 / 6
S4 = S4 & "X: " & x & " " & "V: " & v & vbCrLf
Next i
MsgBox S
MsgBox S2
MsgBox S3
MsgBox S4
End
End Sub
Last edited by Jacob Roman; Feb 22nd, 2006 at 05:48 PM .
Feb 22nd, 2006, 07:12 PM
#39
Re: Need this
VB Code:
Option Explicit
Private Sub Form_Activate()
Dim k1 As Single, k2 As Single, k3 As Single, k4 As Single
Dim l1 As Single, l2 As Single, l3 As Single, l4 As Single
Dim x As Single, v As Single, a As Single
Dim dt As Single, dt2 As Single
Dim f As Single, m As Single
Dim Old_X As Single, Old_A As Single
Dim i As Long
a = 9.8
dt = 1 / 100
x = 0
v = 0
'List1.AddItem ""
List1.AddItem "Euler Integration"
List1.AddItem "---------------------"
For i = 0 To 99
x = x + v * dt
v = v + a * dt
List1.AddItem "X: " & x & " " & "V: " & v
Next i
x = 0
v = 0
List1.AddItem ""
List1.AddItem "2nd Order Euler Integration"
List1.AddItem "---------------------"
For i = 0 To 99
x = x + v * dt + 0.5 * a * dt * dt
v = v + a * dt
List1.AddItem "X: " & x & " " & "V: " & v
Next i
x = 0
v = 0
List1.AddItem ""
List1.AddItem "Newton Stormer Verlet (Semi Implicit Euler)"
List1.AddItem "---------------------"
For i = 0 To 99
v = v + a * dt
x = x + v * dt
List1.AddItem "X: " & x & " " & "V: " & v
Next i
x = 0
v = 0
List1.AddItem ""
List1.AddItem "Velocity-less Verlet Integration"
List1.AddItem "---------------------"
For i = 0 To 99
v = x - Old_X + a * dt * dt
Old_X = x
x = x + v
List1.AddItem "X: " & x & " " & "V: " & v / dt
Next i
x = 0
v = 0
dt2 = dt * dt
List1.AddItem ""
List1.AddItem "Newton Stormer Verlet Variant Integration"
List1.AddItem "---------------------"
For i = 0 To 99
v = v + a * dt2
x = x + v
List1.AddItem "X: " & x & " " & "V: " & v / dt
Next i
x = 0
v = 0
Old_A = a
List1.AddItem ""
List1.AddItem "Velocity Verlet Integration"
List1.AddItem "---------------------"
For i = 0 To 99
x = x + v * dt + 0.5 * Old_A * dt * dt
v = v + 0.5 * (Old_A + a) * dt
Old_A = a
List1.AddItem "X: " & x & " " & "V: " & v
Next i
List1.AddItem ""
List1.AddItem "RK4 Integration"
List1.AddItem "---------------------"
x = 0
v = 0
For i = 0 To 99
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
k3 = dt * (v + k2 / 2)
l3 = dt * a
k4 = dt * (v + k3)
l4 = dt * a
x = x + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6
v = v + l1 / 6 + l2 / 3 + l3 / 3 + l4 / 6
List1.AddItem "X: " & x & " " & "V: " & v
Next i
List1.AddItem ""
List1.AddItem "RK2 Integration"
List1.AddItem "---------------------"
x = 0
v = 0
For i = 0 To 99
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
x = x + k2
v = v + l2
List1.AddItem "X: " & x & " " & "V: " & v
Next i
End Sub
Last edited by Jacob Roman; Feb 23rd, 2006 at 09:37 AM .
Feb 27th, 2006, 09:43 AM
#40
Re: Need this
x - Position
v - Velocity
a - Acceleration
dt - Delta Time
Euler
Aliases: Forward Euler, Explicit Euler
----------------------------------------
x = x + v * dt
v = v + a * dt
2nd Order Euler
----------------------------------------
x = x + v * dt + 0.5 * a * dt * dt
v = v + a * dt
Verlet
Aliases: Velocity-less Verlet
----------------------------------------
v = x - old_x + a * dt * dt
x = x + v
old_x = x
Time Corrected Velocity-less Verlet
----------------------------------------
v = (x - old_x) * (dt / old_dt) + a * dt * dt
x = x + v
old_x = x
old_dt = dt
Prescaled Euler
Aliases: Newton Stomer Verlet Variant
----------------------------------------
v = v + a * dt * dt
x = x + v
Re-ordered traditional Euler
Aliases: Semi-Implicit Euler, Newton Stormer Verlet, Backwards Euler
----------------------------------------
v = v + a * dt
x = x + v * dt
Velocity Verlet
----------------------------------------
x = x + v * dt + 0.5 * Old_A * dt * dt
v = v + 0.5 * (Old_A + a) * dt
Old_A = a
2nd Order Runge Kutta,
Aliases: Midpoint Method, RK2
----------------------------------------
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
x = x + k2
v = v + l2
4th Order Runge Kutta
Aliases: RK4
----------------------------------------
k1 = dt * v
l1 = dt * a
k2 = dt * (v + k1 / 2)
l2 = dt * a
k3 = dt * (v + k2 / 2)
l3 = dt * a
k4 = dt * (v + k3)
l4 = dt * a
x = x + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6
v = v + l1 / 6 + l2 / 3 + l3 / 3 + l4 / 6
DO NOT COPY & PASTE
http://www.scottsarra.org/nHam/nHam.html
The Gaffer Articles.....FINALLY
Even Better, The best rigid body stacking demo with code
Integration Timestep
Little help with the Physics engine
Last edited by Jacob Roman; Mar 7th, 2006 at 09:44 AM .
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width