Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: 1 ... 99 100 [101] 102 103 ... 116
1501
Support / Re: A Little Trigonometry
« on: June 05, 2009, 01:11:59 am »
Egon, what kind of a problem could the direction markers have? I store the center of my car and the opponent car follows the markers perfectly.

And paulscode, thanks for the tip, but on a PC (where performance differences won't be that significant) isn't that a little bit overkill?

1502
Support / Re: A Little Trigonometry
« on: June 04, 2009, 09:22:18 am »
If you mean something like the following, it didn't do it for me either.

Code: [Select]
opponentCar.setRotationMatrix(rails[currentDirectionMarker].getRotationMatrix());

1503
Support / Re: A Little Trigonometry
« on: June 04, 2009, 08:39:30 am »
Thanks for the blitting suggestion, I'm about to try it out. But yes, it's really an animated gif I want drawn (but at this point I'll settle for a static one).

And no, your approach constantly rotates the car in odd angles. The closest one so far has been paulscode's latest, but even that doesn't quite do it.

And I solved the speed issue (I was working from a constantly-updated carCenter). Sorry if I waste your time sometimes, but I really try not to. This particular question took me a couple of days to ask. I think something happens with me after I ask a question (unburden myself, I suppose!) that I think more clearly. So, down to two problems. :-)

1504
Support / Re: A Little Trigonometry
« on: June 04, 2009, 08:06:13 am »
It's not supposed to be uneven, it sleeps 40 milliseconds, and draws. Obviously some parts of the model might take a little longer to render, but it should hardly be perceptible, and it really really is.

Egon, on yet a separate question (not to draw too much attention away from the bigger turning problem), how do I draw an image onto the buffer using the hardware renderer outside of an AWTGLCanvas? I've tried reading the lwjgl docs, but I found nothing there. I even tried looking for my C OpenGL programs of so many years ago, but I can't find them right now. Do you know?

1505
Support / Re: A Little Trigonometry
« on: June 04, 2009, 03:07:21 am »
I applied your change and the result is conservative (it does most of the rotation, maybe 70% of it, but never quite enough). Also, since my streets always turn left, I didn't get to test a right turn, although I supposed your applet does. Here's a quick question: why doesn't the following code produce an even speed?

Code: [Select]
float translationAmount = 72f/distance; //MOVE % OF distance THAT EQUALS 72
SimpleVector directionMoved;
directionMoved = moveTowardsMinusZ(opponentCar, rails[currentDirectionMarker], translationAmount);
//THE DISTANCE IS UPDATED WHENEVER calculateDistance(opponentCar.getTransformedCenter(), rails[currentDirectionMarker]) < 1f AND currentDirectionMarker IS INCREMENTED
//THEN THE MOVETOWARDS METHOD CALCULATES THE DELTAS:
float deltaX = (direction.x -origin.x)*translationAmount;
float deltaY = (direction.y -origin.y)*translationAmount;

1506
Support / Re: A Little Trigonometry
« on: June 03, 2009, 07:58:59 pm »
Thanks, man, and I wish I could take credit for the model, but I bought it. :-) I'm preparing a website with a bunch of things I did over the years (since I didn't finish a lot there's a lot to do), but I'll be posting the links here as I finish them.

1507
Support / Re: A Little Trigonometry
« on: June 03, 2009, 06:10:41 pm »
Almost right, except that I'm only rotating the car every time I increment the array index of world coordinates, as opposed to in every iteration of the game loop.

1508
Support / Re: A Little Trigonometry
« on: June 03, 2009, 05:54:57 pm »
The world coordinates are invisible. I store them by setting the program in store mode, at which point the opponent car doesn't move and I drive in its place while my program stores my position. The rest you can see in the screenshot:

1509
Support / Re: A Little Trigonometry
« on: June 03, 2009, 05:45:45 pm »
Egon: it's a bad thing in that the car rotates awckwardly even on straight lines. Then again, if the formula eventually works...

Paulscode: yeah, the child object is directly in front of it, but no, the car isn't using pointer to move, it's chasing an array of SimpleVectors. I put the pointer there just so I could get a triangle from which to calculate theta. And the car is moving exactly as it should except that after the first turn it's not facing forward.

1510
Support / Re: A Little Trigonometry
« on: June 03, 2009, 06:40:56 am »
Here's a note: while Egon's code rotates the car even on straight lines, paulscode's code doesn't. So if either of you is reading, I think that's an important observation. I'll try and get this thing working in applet form and post a link here tomorrow.

1511
Support / Re: A Little Trigonometry
« on: May 31, 2009, 12:04:58 am »
Yes, and it loads fine. Ever since they made appletviewer (and just to be clear I'm not using it, I'm using Explorer and Firefox) security permission-aware, I've found applet writing and testing to be a nightmare, which is why I first wrote this program as an application. But I'll solve it soon enough, I suppose. Really, my only rush is that I don't want you to go offline! :-)

1512
Support / Re: A Little Trigonometry
« on: May 30, 2009, 11:56:48 pm »
I took it out and it doesn't even get to the OutofMemoryError, but that was a good suggestion.

1513
Support / Re: A Little Trigonometry
« on: May 30, 2009, 11:31:37 pm »
Sure, and thanks for your suggestion, but I recopied the lwjgl applet files and nothing changed (same error 7).

Code: [Select]
<html>
  <applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar, lzma.jar" codebase="."

width="800" height="600">
    <param name="java_arguments" value="-Xmx320m">
    <param name="al_title" value="Racer v. 0.1">
    <param name="al_main" value="Racer">
    <!-- logo to paint while loading, will be centered -->
    <param name="al_logo" value="Car.gif">
    <!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done -->
    <param name="al_progressbar" value="appletprogress.gif">
   
    <!-- signed windows natives jar in a jar -->
    <param name="al_windows" value="windows_natives.jar.lzma">

    <!-- List of Jars to add to classpath -->
    <param name="al_jars" value="Racer.jar, jpct.jar, lwjgl_applet.jar.pack.lzma, lwjgl.jar.pack.lzma,

jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma, res.jar.lzma">
   
    <!-- signed linux natives jar in a jar -->
    <param name="al_linux" value="linux_natives.jar.lzma">
   
    <!-- signed mac osx natives jar in a jar -->
    <param name="al_mac" value="macosx_natives.jar.lzma">

    <!-- signed solaris natives jar in a jar -->
    <param name="al_solaris" value="solaris_natives.jar.lzma">
   
    <!-- Tags under here are optional -->
   
    <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be

int or float -->
    <!-- <param name="al_version" value="0.8"> -->
   
    <!-- background color to paint with, defaults to white -->
    <!-- <param name="al_bgcolor" value="000000"> -->
   
    <!-- foreground color to paint with, defaults to black -->
    <!-- <param name="al_fgcolor" value="ffffff"> -->
   
    <!-- error color to paint with, defaults to red -->
    <!-- <param name="al_errorcolor" value="ff0000"> -->
   
    <!-- whether to run in debug mode -->
    <!-- <param name="al_debug" value="true"> -->
   
    <!-- whether to prepend host to cache path - defaults to true -->
    <param name="al_prepend_host" value="false">

  </applet>

  <p>
    if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the

loader process.
  </p>

  </body>
</html>

1514
Support / Re: A Little Trigonometry
« on: May 30, 2009, 10:47:47 pm »
Do you happen to know what lwjgl's AppletLoader's error 7 is? It doesn't print anything other than that it's error 7 in the Java console.

1515
Support / Re: A Little Trigonometry
« on: May 30, 2009, 09:37:17 pm »
Got it, thanks. I'm going to turn this into an applet really fast and show you how it's turning with that code you posted (and I reposted!). But no, it's not a simple question of turning the opposite way unfortunately.

Pages: 1 ... 99 100 [101] 102 103 ... 116