|
Post by shadow008 on Jun 15, 2010 10:42:54 GMT -5
Does anyone have knowledge on how the materials and uv coords work in .obj files (exported from blender) I have absolutely no idea as to what im doing anymore. shadow008.wikispaces.com/file/detail/FPS+camera.zipTheres a screen shot of what it looked like when i exported it to blender. And if you run the code, it doesnt look like it should... EDIT: actually... i just fixed a portion of the problem(thank god blender is open source). But the textures are still a little messed up... The snow quadrant seems to be just fine but the others are as if they got swapped for the coords after them... ANOTHER EDIT: sorry, i didnt even realize i had all that text displaying... Just ignore it - or delete it. also: disable the lighting and remove the color command on the box, it brightens things up a bit...
|
|
|
Post by Darkjester on Jun 15, 2010 11:24:05 GMT -5
Check the way the model exports as for the mtl and obj files go to google and get the spec my model loader can map 12 textures to one solid model without vertex groups with a standard obj export from blender
|
|
|
Post by shadow008 on Jun 15, 2010 13:51:19 GMT -5
oh... actually what i had worked fine, i just forgot to change back the modifications i added to the .obj file.... *EPIC FACE-PALM* -_- EDIT: I just finished a texture for it in GIMP (which fails, but its free) and modded some of the code shadow008.wikispaces.com/file/detail/FPS+camera.zipits pretty terrible but.....
|
|
|
Post by DJLinux on Jun 16, 2010 4:15:08 GMT -5
hello Shadow sorry but something is wrong with your timing math if i start it and wait that the player hits the ground than i press only [w] and can go smooth forward but only for ~4-5 seconds after it i get only one frame per second. May be only a short error. Joshy
|
|
|
Post by shadow008 on Jun 16, 2010 16:57:26 GMT -5
nope, nothing wrong with the math, its tokamak and its bitchyness with the coords (0,#,0). I have no idea as to why it does that but keep clear of x axis = 0 and z axis = 0 It usually drops the frame rate to < 5 fps... Like i said, I have absolutely no idea as to why it does that but...
|
|
|
Post by DJLinux on Jun 16, 2010 17:51:01 GMT -5
I see more than one errors in your code the number of glPush and glPops are different (very bad) your usage of sensors are a litle bit wrong you must use the current calculated sensors inside of the callback (not any global sensor and i see you use an second cam.walk sensor too) for "how to handle diffrent sensors inside of an callback" take a look to " SensorTest01.gb" here are pseudo code: sub ControllerCallBack() dim controller,rb,sensor ...
controller=getcontroller() rb=getrigidbody(controller)
BeginIterrateSensors(rb)
sen=getNextSensor(rb)
while sen.this ' it an active legal sensor ' witch sensor is it use user data or what ever if sen.userdata() = MyIDSensorA then ' work with sen as sensor A ' ... elseif sen.userdata() = MyCamWalkSensorID then ' work with sensor as sensor B (cam.sensor) ' ... end if sen=getNextSensor(rb) wend end sub [/size]may be your math or sensor will fail if the corner of the terrain is to sharp more tips for the future: don't use gosub don't mix double and single (normaly no problem it is the same in Basic4GL but let it be may be internal rounding problems and don't use it for plugins) don't use global sensors don't ignore the return value from function (if all works in your final version you can ignore error checking) and remember physics and physics engines at all isn't easy but i'm sure you will learn it step by step. I rewrote the the tokamak C++ lib for GFA Basic and the first test works great. You can try to use the current terrain with any old working code from you. If it will don't stop you know something is wrong in you current version. Don't worry you will get it all and may be in 3 month or so you are an expert in tokamak physics engine and you will laught over your current code ;D Joshy
|
|
|
Post by shadow008 on Jun 16, 2010 19:04:35 GMT -5
# of glPush > # of glPop ... i did not even notice that. yeah, i know not to use gosub, it was just thrown in there as a test and not to clutter the main loop. mixing singles and doubles i learned is a bad thing during robotics build season, produces horrible rounding errors when mixing both different plugins and different languages XD as for the global sensor, are you referring to the down sensor or the walk sensor. The walk sensor because it changes direction?... And what do you mean ignoring the return value of a function? Thanks so much for your feedback and help! ;D EDIT: i tried using SensorSetUserData(sensor,data) but it keeps saying "an exception occured" every time i use it. The data is just a simple integer and is set right after the sensor is created, like this: const ID as integer = 1 ..... sensor = RigidBodyAddSensor(rb) SensorSetUserData(sensor,ID) .... any ideas? Another EDIT: WAIT, WHUT?!?!?! i just ran my code to test it and... it didnt work why? well, heres what it went to afterwards: SimulatorAdvance(PhysicsSim,(60/FPS)*.02,1) | <-- cursor here reason for breaking: reDIMmed variable wtf?! Yet Another EDIT: omg i figured it out. When SimulatorAdvance is called, it also calls all the controllers,collision callback subs,ect. And i dimmed a variable in my controller callback that was the same name as one in my collision callback XD. These are the moments i love as a programmer. but i still have the whole "exception occured" error...
|
|
|
Post by DJLinux on Jun 16, 2010 20:24:31 GMT -5
I will see whats going wrong i never tested "SensorSetUserData(sensor,ID)" thanks for this info.
Joshy
|
|
|
Post by DJLinux on Jun 16, 2010 20:54:51 GMT -5
It was an NULL pointer fixed you can download the plugin again.
Joshy
|
|
|
Post by shadow008 on Jun 16, 2010 20:57:22 GMT -5
thanks a bunch
|
|