Main Menu
Menu

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.

Show posts Menu

Messages - AGP

#1531
Support / Re: A Little Trigonometry
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).

<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>
#1532
Support / Re: A Little Trigonometry
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.
#1533
Support / Re: A Little Trigonometry
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.
#1534
Support / Re: A Little Trigonometry
May 30, 2009, 09:22:48 PM
And Egon, yours also doesn't work. Both are turning the car in odd directions, and I think it might be because my +Z is up. Sorry for the mathematical ignorance, but you forget so much after ten years without looking at this stuff much. Now, I'm thinking I'll brush up later. :-)

But here's a question: which method should be faster (yours or paulscode's), even if trivially? Are their results equally reliable?
#1535
Support / Re: A Little Trigonometry
May 30, 2009, 09:18:36 PM
I'm rotating around the Z axis (+Z is up, the car moves on the X/Y plane). I'm not sure what your rotationAxis is suppose to do or for that matter where to plug it.
#1536
Support / Re: A Little Trigonometry
May 30, 2009, 08:45:11 PM
They're world coordinates. Pointer is taken from the center of the car's child (which is a lot like that target I made for my ship to follow in that other game, if you remember). Direction is a world coordinate that the car has to chase (it's pretty much on rails--I'll come up with a pathfinding algorithm later). So I did this, but the car still doesn't rotate right. Do you have any idea why? And thanks in advance, pal.
SimpleVector a = direction.calcSub(center).normalize();
SimpleVector b = opponentPointer.getTransformedCenter().calcSub(center).normalize();
float lengthC = b.calcSub( a ).length();
float theta = (float) Math.acos( (2.0f - (lengthC * lengthC) ) / 2.0f );
#1537
Support / Re: A Little Trigonometry
May 30, 2009, 07:40:07 PM
I don't think I got this right:

SimpleVector center = opponentCar.getTransformedCenter();
SimpleVector a =  new SimpleVector(center);
a.add(direction);
SimpleVector b = new SimpleVector(center);
b.add(opponentPointer.getTransformedCenter());
float cosine = a.calcDot(b)/(Math.abs(a.x*a.y)*Math.abs(b.x*b.y));
float arcCosine = (float)Math.acos(cosine);
#1538
Support / A Little Trigonometry
May 30, 2009, 06:32:34 PM
I need to find the theta of the following triangle. The only trigonometry book I kept from school doesn't answer this very well. Can anyone help?

#1539
Support / Re: Texture.setAlpha(int)
May 29, 2009, 08:29:26 PM
OK, good, so that answers it. I'm not sure how I can change this object, which is REALLY complex, but I'll try later and at least I know why it wasn't working. Thanks a lot.
#1540
Support / Re: Texture.setAlpha(int)
May 29, 2009, 07:06:46 PM
Yeah, I did almost exactly the same thing you did, except that my model is far bigger, and each segment of it is made up of many parts, each of which with different textures. Plus, I loaded my textures before the model (as per jPCT norm) and I never called model.setTexture(Texture). Other than that, I did the same thing, so that leads me to believe that it's the multi-texture thing. Egon?
#1541
Support / Re: Texture.setAlpha(int)
May 29, 2009, 04:16:11 AM
It's a single 3ds file with multiple parts to it, but are merged into one via Object3D.mergeObjects(Object3D,Object3D). Let me have a look at your code and get right back to you. And thanks again.
#1542
Support / Re: Texture.setAlpha(int)
May 29, 2009, 12:24:13 AM
Thanks for your suggestions, although none of them worked and my images have no background. I even tried the black thing, and setting useAlpha to false. It is supposed to work on the software OpenGL, right? And another question: the docs for setAdditionalColor(java.awt.Color) say it's possible for you to set a color above 255, 255, 255 for lightsources and such, except that the JRE throws an IllegalArgumentException when your values are brighter than white. So what gives?

EDIT: I should specify that this object has a million textures, not just the one. Does that matter?
#1543
Support / Re: Texture.setAlpha(int)
May 28, 2009, 07:51:15 PM
I'll post two screenshots later today of what I'm writing about, but right now suffice to write that the alpha areas in my png texture are showing up as white. Is it possible to make them invisible?
#1544
Support / Re: Texture.setAlpha(int)
May 28, 2009, 08:10:16 AM
I'm confused. I want to tell the renderer the color blue should be invisible. Is that doable? And I tried Color.blue.getAlpha() as well to the same result, but I guess you just explained that its alpha would be opaque. But isn't the purpose of the setAlpha(int) method to make a given area transparent?
#1545
Support / Texture.setAlpha(int)
May 28, 2009, 04:07:29 AM
I thought when I saw this method in the documentation that I would be able to select a texture then say texture.setAlpha(Color.blue.getRGB()), and that would make every blue area completely transparent. Since there's nothing in the docs to explain what it's supposed to do, what exactly is it supposed to do? And more importantly to me, how do I achieve the same result as the one I expected? Thanks in advance.