Various SlimDX - DirectX programming questions
2 posters
Page 1 of 1
Various SlimDX - DirectX programming questions
I open a post to groupd all question regarding game programming with DirectX/SLimDX.
Can you tell me wich timer your are using ? (To compute time pass between 2 frames and doing related interpolation for movement) ?
Tx !
Can you tell me wich timer your are using ? (To compute time pass between 2 frames and doing related interpolation for movement) ?
Tx !
S33m3- Posts : 54
Join date : 2011-03-23
Re: Various SlimDX - DirectX programming questions
I use a Dotnet Stopwatch and use this to get the milliseconds...
(1000.0 * sw.ElapsedTicks) / Stopwatch.Frequency
(1000.0 * sw.ElapsedTicks) / Stopwatch.Frequency
Slaihne- Posts : 264
Join date : 2011-03-17
Age : 56
Re: Various SlimDX - DirectX programming questions
Same as me ... Still searching where my accuracy problem are coming from...
Another question
How do you "fight" against Float precision problem ?
Camera world coordinate in double then transformed to float before computing view matrix ?
In my system I use the camera position as the center of the "world", and all the others objects are offset based on the camera world position.
Another question
How do you "fight" against Float precision problem ?
Camera world coordinate in double then transformed to float before computing view matrix ?
In my system I use the camera position as the center of the "world", and all the others objects are offset based on the camera world position.
S33m3- Posts : 54
Join date : 2011-03-23
Re: Various SlimDX - DirectX programming questions
I handle all the 'chunks' vertices as relative to the chunk. So, vertex co-ords range from 0..16 in x and z and from 0..128 in y.
Then i pass into my draw call a value i call the CamChunkOffset. This is the camera position, adjusted by the world co-ords for the chunk. I then adjust the vertex positions, within the draw, by this value. It sort of puts the vertex at it's world co-ords and then moves it relative to the camera in a single operation.
Then i do the whole view projection thing to transform the camera relative vertex.
It works but i still need to do some more testing to see if it works for larger values.
Then i pass into my draw call a value i call the CamChunkOffset. This is the camera position, adjusted by the world co-ords for the chunk. I then adjust the vertex positions, within the draw, by this value. It sort of puts the vertex at it's world co-ords and then moves it relative to the camera in a single operation.
Then i do the whole view projection thing to transform the camera relative vertex.
It works but i still need to do some more testing to see if it works for larger values.
Slaihne- Posts : 264
Join date : 2011-03-17
Age : 56
Re: Various SlimDX - DirectX programming questions
It's funny that in the end we are doing the same things ...
So it means that your View matrix location component is always (0,0,0). (In fact the view matrix location is incorporated inside the Object world matrix).
Like me at every frame (or everytime the camera is moving) you have to recompute for every world object it's "CamChunkOffset" on the "CPU".
At first it was strange to me, but what we are doing : "Instead of moving my camera, I will move all objects surrending my camera". This way the objects are placed in the world based on theirs position to the camera.
Do you store your camera world position into Float or double value ?
So it means that your View matrix location component is always (0,0,0). (In fact the view matrix location is incorporated inside the Object world matrix).
Like me at every frame (or everytime the camera is moving) you have to recompute for every world object it's "CamChunkOffset" on the "CPU".
At first it was strange to me, but what we are doing : "Instead of moving my camera, I will move all objects surrending my camera". This way the objects are placed in the world based on theirs position to the camera.
Do you store your camera world position into Float or double value ?
S33m3- Posts : 54
Join date : 2011-03-23
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Fri Jul 01, 2016 7:25 am by croxxx
» Source?
Thu Jul 12, 2012 9:55 am by raistlinthewiz
» Version Available (Take 2)
Sat Jun 09, 2012 3:23 am by kamild1996
» Terrain Rendering Bug
Thu May 17, 2012 8:07 am by sackboy789
» Mystery Block!
Thu Mar 29, 2012 4:42 am by Corvin73
» Your procedural tree/plant seeding technique?
Sat Mar 24, 2012 3:10 am by Slaihne
» Voxeliq project
Wed Mar 07, 2012 4:25 am by raistlinthewiz
» What is a Tech-Test?
Wed Jan 18, 2012 12:32 pm by joeydmars
» Images
Fri Jan 06, 2012 6:02 am by croxxx