• Advertisement

Steve00000

Member
  • Content count

    40
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Steve00000

  • Rank
    Member
  1. Theres texture distortion on my cube : (

    I found that blender does not come ready with .vtx output. I did try to change some of the source data in my first post, and got *more correct results. Because of this odd situation, if ppl wouldn't mind suggesting a file format that blender comes ready with output for and providing a link to the format specs I'd be really greatful. I had a look at a few of the formats but couldn't find much info on em. I was being kinda picky I guess cause I wanted tex coords and vertex data together, but I thought the 3ds format looked interesting, but I didn't find a resource for its specs.
  2. Theres texture distortion on my cube : (

    so maybe the problem is with the editor program i made the cube with? perhaps i'll try blender and see if it can output in vtx, then reload the program
  3. Theres texture distortion on my cube : (

    I'll see if I can figure out how to upload one.
  4. Hi, I'm trying to draw a texture on a large cube. The cube is loaded from a .vtx model file which is made with anim8or. When the cube is drawn only two faces on the cube are displayed correctly. The sides of the cube that are not drawn correctly are distorted and look as though they have been stretched from the correctly drawn sides edge to other. This is the code that is meant to draw the cube: // 1 based array glBindTexture(GL_TEXTURE_2D, texture(1)); glBegin(GL_TRIANGLES);//);GL_TRIANGLES for(int iter = 0; iter < cubesy.index().size(); iter++) // 36 indices, 24 vertices { int index = cubesy.index()[iter]; const cvertex& vertref = cubesy.vertex()[index]; const point3<short>& normref = cubesy.normal()[index]; glNormal3s(normref.x, normref.y, normref.z); glTexCoord2s(vertref.u, vertref.v); glVertex3f(vertref.x, vertref.y, vertref.z); } glEnd(); here is the data from the vtx file // mesh01 // 24 vertices // NOTE: first 3 are a vertex, second 3 are a normal, last 2 are a tex coord .Vertex -4.13221 -4.71958 -4.71959 0 0 -1 0 0 5.30695 -4.71958 -4.71959 0 0 -1 1 0 5.30695 4.71957 -4.71959 0 0 -1 1 1 -4.13221 4.71957 -4.71959 0 0 -1 0 1 5.30695 -4.71958 4.71957 0 0 1 1 0 -4.13221 -4.71958 4.71957 0 0 1 0 0 -4.13221 4.71957 4.71957 0 0 1 0 1 5.30695 4.71957 4.71957 0 0 1 1 1 5.30695 -4.71958 -4.71959 1 0 0 1 0 5.30695 -4.71958 4.71957 1 0 0 1 0 5.30695 4.71957 4.71957 1 0 0 1 1 5.30695 4.71957 -4.71959 1 0 0 1 1 -4.13221 4.71957 -4.71959 0 1 0 0 1 5.30695 4.71957 -4.71959 0 1 0 1 1 5.30695 4.71957 4.71957 0 1 0 1 1 -4.13221 4.71957 4.71957 0 1 0 0 1 -4.13221 -4.71958 -4.71959 -1 0 0 0 0 -4.13221 4.71957 -4.71959 -1 0 0 0 1 -4.13221 4.71957 4.71957 -1 0 0 0 1 -4.13221 -4.71958 4.71957 -1 0 0 0 0 -4.13221 -4.71958 -4.71959 0 -1 0 0 0 -4.13221 -4.71958 4.71957 0 -1 0 0 0 5.30695 -4.71958 4.71957 0 -1 0 1 0 5.30695 -4.71958 -4.71959 0 -1 0 1 0 // end of .Vertex // 12 faces .Index 0 1 2 -1 0 2 3 -1 4 5 6 -1 4 6 7 -1 8 9 10 -1 8 10 11 -1 12 13 14 -1 12 14 15 -1 16 17 18 -1 16 18 19 -1 20 21 22 -1 20 22 23 -1 // end if .Index The source that I read about how to read from this file format said to draw as triangles, which is being done of course. However maybe I'm doing something wrong, even tho I did check that the data is being read in properly, and the drawing routine has the right stuff at the right time. Anyways for anyone who helps me, Thx : )
  5. this is pretty bad timing but since last time i posted, im not getting said error anymore :S, i'll follow your advice if it pops up again before this thread dies.
  6. JSAPI, getting a jsval to work

    This did help alot, I got my program workin. Thanks
  7. Im using the java script api by mozzila, and I'm having one problem mainly. I've made a native function I've linked to my java script context that I can use in my actual java script. The functions purpose is to return a string obtained from the consol. However in my "Native" code, I cant figure out how to make the return value parameter of my function return a string, or at least a pointer to one, and setting the return val to an integer - when printed, is not the value I set it to. Here's an example of the "native" code: jsrsig Java_Gets (::JSContext* cx, ::JSObject* obj, ::uintN argc, ::jsval* argv, ::jsval* rval) { *rval = 5; return JS_TRUE; } and heres some java script code: sprint("JAavascript demo\n"); function print_x(num_times, words){ for(iter = 0; iter < num_times; iter++){ sprint(words+"\n"); } } var momo = sgets(); print_x(6, momo); what happens is it prints 2 six times, any help would be greatly appreciated.
  8. I did use such a macro, it looks like this, (fyi I dont know how to make code segments here so im just gonna post it right in the chat). I didnt know to use extern "C", but I wanted to have the functionality I needed in a class, so that I can have multiple javascript contexts and runtimes as needed (although they are a rare case apparently). #ifndef _JSHELPERDLL #define jsHlpDll __declspec(dllimport) #if _DEBUG #pragma comment(lib, "C:\\Code Snip\\djsHelper.lib") #else #pragma comment(lib, "C:\\Code Snip\\jsHelper.lib") #endif #else #define jsHlpDll __declspec(dllexport) #endif #define jsrsig ::JSBool // adding a function to the jscontext requires this return type, and those parameters #define jspsig (::JSContext *cx, ::JSObject *obj, ::uintN argc, ::jsval *argv, ::jsval *rval) namespace cJScript { typedef ::JSScript* jscript; // try class encapsulation for destruction struct sJavaHelp { ::JSRuntime* runtime; ::JSContext* context; ::JSObject* object; ::JSClass* mclass; jsHlpDll void InitJScript(long bytes = 0x100000); jsHlpDll bool AddStandardClasses(); jsHlpDll void AddFunction(JSNative, const char* name, short num_args); jsHlpDll void DestroyScript(jscri
  9. I build a dll to assist in future projects, but occasionally sometimes when I go to build a program that links to it I get the error "?shutdown@blabla@blablablabla - failed to find the entry point in blabla.dll." Im just wondering what I should do in such a situation, as most would agree, errors, and situations like this are annoyiing. if you disagree with my naming i can change those blablas for you, I dont actually use blabla as a naming tool XD. btw i use the __declspec(dllimport/export) declaration modifiers, cause .defs with c++ are apparently annoying to make
  10. #include <windows.h> #include <mmsystem.h> #include <mmreg.h> interestingly if you compile with the headers included exactly in this order, at least in my case you end up with no errors, also dsound.h doesnt mind being under those either!!!! ARG (in a non yelling fashion)
  11. its true, I include mmreg.h into my vc project and get errors in numbers to high to count. originally it was being included in my game lib but i tried it in a simple seperate project and still got endless errors. this seems to be the primary error: C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\mmreg.h(2262) : error C2146: syntax error : missing ';' before identifier 'wFormatTag' and then a few hundered later its complaining that NEAR and FAR have been redefined. Does anyone else have this problem? Know a solution? winmm.lib doesnt seem to actually help in its inclusion
  12. It finally works, not exactly the way i'd hoped but it probably cant be helped. What I ended up doing was building onto the vector array of sprites after the update calls therefor having the translation done, and passed into an array and then erasing all its elements after the draw call. However to my dissapointment it hasent improved performance.
  13. Hmm those are good points (all of which I DID do), especially the one about the translation, this is something I didnt think about; and I guess it would make sense since my vector list is only being built on a game object is made but not updated accordingly to a game objects possition. The immediate one doesnt need flush. But the translation isnt happening and is now my key lead here, I thank you for your suggestions. I had all the other stuff figured out, and drawing before, but it came to my attention, or at least in my own experience that calling draw sprite buffered and immediate for each game object can cause the program to slow. So I'm tryin out having a list prepared before the actual draw call(s), in an attempt to see if that would solve my problem.
  14. I saw a post that said to build an array of D3DX10_SPRITES, I'v tried this: // exists always in a game object manager, and built on when a game object is made std::vector<D3DX10_SPRITE> SpriteList; // called in render function DrawSpritesImmediate(&SpriteList[0],SpriteList->size(),0,0); This compiles fine, but shows nothing, did I miss something, the awnser is probably easy, but I feel like I'v tried everything
  • Advertisement