![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
GLOBAL MODDING TERRORIST
|
![]()
It's a problem with floats.
From Graeme at SweetScape............ "The error you are seeing is caused because 'float' is not very accurate for doing a lot of computations. We tried your function in C++ and it gives the same issue. 'float' is just not very accurate and if you switch to 'double' it will be better, although double has accuracy issues as well for lots of computations." Then next section (Faces) uses all ints so shouldn't have a problem. ![]() One thing I am doing is writing separate scripts for each part. Verts, Vertical Textures, Faces are all separate scripts. Makes catching errors easier. The 1st script calls the next 2 in order just as if it was all one script. |
![]() |
![]() |
![]() |
#2 |
GLOBAL MODDING TERRORIST
|
![]()
How to code the faces output.
Given there are 10000 faces? Each line must follow the formula below. The loop will be slow but should work. This is NOT actual code but gives the information to code the needed loop. ---C1------ C2------ C3---- C4 f 1/101 102/100 103/201 2/202 f 2/202 103/201 104/302 3/303 C1 = +1/+101 C2 = +1/+101 C3 = +1/+101 C4 = +1/+101 Last edited by Jeff-Groves; 02-01-19 at 11:46 AM. |
![]() |
![]() |
![]() |
#3 |
GLOBAL MODDING TERRORIST
|
![]()
At first look you may think we need a double loop like for the Textures.
Actually a single loop will work for our needs so speed goes up. Look close at the faces ints and the pattern. You may think 8 ints are needed. |
![]() |
![]() |
![]() |
#4 | |
CTD - it's not just a job
|
![]() Quote:
![]()
__________________
"...and bollocks to the naysayers" - Jimbuna |
|
![]() |
![]() |
![]() |
#5 |
GLOBAL MODDING TERRORIST
|
![]()
The support from SweetScape is one big reason I pay to stay updated.
![]() |
![]() |
![]() |
![]() |
#6 |
GLOBAL MODDING TERRORIST
|
![]()
Have you figured out the loop needed to output 10000 faces yet?
And the MINIMUM number of ints needed to do it? ![]() If your answer is above 3 ints? ![]() Your wrong! ![]() Last edited by Jeff-Groves; 02-01-19 at 01:01 PM. |
![]() |
![]() |
![]() |
#7 |
CTD - it's not just a job
|
![]()
Is there a way to do like a "Do Loop Until EOF"?
![]()
__________________
"...and bollocks to the naysayers" - Jimbuna |
![]() |
![]() |
![]() |
#8 |
GLOBAL MODDING TERRORIST
|
![]()
We only need one looping function to do everything.
I have 3 ints assigned in my loop right now. 2 only control the number of loops I do. The other is for kicking out the faces information. I take advantage of the Printf function to do the math. ![]() Here's an example.............. f=(f+1); Printf("f %u", f); Printf( "/%u ", f=(f+100) ); Those lines print out 1/101 That's the first part of a face. Each line of Printf needs to be coded or numbers go real FUBAR! What I mean by that is that using f on a single line in Printf can corrupt the data. By using different lines? It preserves the true value of f for further math. BUT! We can loop the code to print out all 10000 lines easily. Last edited by Jeff-Groves; 02-01-19 at 02:47 PM. |
![]() |
![]() |
![]() |
#9 |
CTD - it's not just a job
|
![]()
Nice. I keep confusing "program code" and "scripting"... In other words, I want to write an application in one fell swoop. You're getting the data and its structure, to be used in an app... baby steps. must take baby steps pb...
![]()
__________________
"...and bollocks to the naysayers" - Jimbuna |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|