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 - EgonOlsen

#12091
Maybe your naming when adding the textures to the manager doesn't match the naming of the textures in the material. The fps-example loads and adds them with their complete name, i.e. "car1.jpg", while in your applet example, you simply named the texture "car1".
Have a look at the console output...does the loader prints out some messages like

Texture named blahblah.jpg added to TextureManager!

? If so, your naming is definitely not correct and your should add your textures using the exakt name that's defined in the material.
#12092
News / Working on new example
April 29, 2004, 10:18:18 PM
Just to prove that i'm still working on the new example...it can do simple skidmarks now:

#12093
Support / Problem importing 3ds files into applet
April 29, 2004, 03:56:13 PM
3DS is fine for applets. You just have to take care that you are using the appropriate method to load it. The Loader-class offers three variants for each kind of model. One is for applications, one for applets (the one with the document base) and one for input streams. For an applet, you may use the applet  version (the document base can be obtained from the applet by calling this.getDocumentBase()) or you include your model into a JAR and load it using an input stream (this.getClass ().getResourceAsStream("....") or similar). That will work with applications, applets and webstartable application, so it may be the better choice in the long run.
BTW: Don't use "\" as a separator in your path but "/" when loading from within your applet.

Hope this helps.
#12094
Support / 3D points/lines and polygon normals
April 28, 2004, 10:01:52 PM
Quote from: "Musurca"For example, if you were bouncing a ball on a jagged surface, and you wanted to figure out the direction in which the ball would rebound after impact, you'd definitely need to figure out the polygon normal quickly.
FYI: The new version (1.00+) offers a way to get this information (normals and vertices of single polygons in world space) via an object's "PolygonManager".
#12095
News / Version 1.00 has been released!
April 28, 2004, 09:55:51 PM
Yes, we are at 1.00 now...but that doesn't mean anything... :wink:
This version has been ported to LWJGL 0.9 and it won't run with 0.8 (or lower) anymore. So it's time to upgrade your LWJGL installation to 0.9 here: http://www.lwjgl.org
This version doesn't include the announced terrain following example, because i didn't make it in time for this release.
Anyway, it offers some new and improved ways to work on the polygon level of objects.
All changes are documented here:

http://www.jpct.net/changes.html

Have fun!
#12096
Support / Interact2D not using camera transform
April 27, 2004, 12:03:10 AM
Well, the picking takes place in camera space, i.e. the space where the camera is always located at (0,0,0) and looking down the z-axis. That's the space the visibility list is in and that's also the space the ray is in. That's why it doesn't reflect the camera's transformation and for picking from the visibility list, it doesn't have to. IF you want to use this ray for anything else then picking with the provided methods, then you have to do the transformation "by hand" (which reminds me to add a method to ease this case...instead of working with the dump).
Hope this helps.
#12097
Support / jPCT for an engineering type app?
April 20, 2004, 08:55:05 PM
Quote from: "xander"It would be nice in fact to do all of the following: line, arc, circle, ellipse, polyline.
I agree that this would be a helpfull addition in some situations, but it's not jPCT's main goal to offer such things. If you really need it, you can either use the Java2D-stuff on top of a software rendered image (works for Java2 only, because a MemoryImageSource doesn't provide you with a usable Graphics-instance) or render the lines and circles in an int[]-array and blit that into the rendered image (works with OpenGL too).
#12098
Support / picking to 3d coordinate
April 19, 2004, 10:47:21 PM
Quote from: "Anonymous"some research turned out it to be the # triangle added - without zerosizetriangles (and maybe other other unnessescary triangles :)  )
Yes, that's the way jPCT behaves. I could say "at the moment" and that this behaviour may change sometimes...but that won't be the case...it's pretty save to rely on this behaviour.
However, a better solution would be to make each tile of the board an individual object. The overhead introduced by this should be neglectable as long as the board doesn't consist of thousands of tiles. That's much more flexible and allows to implement additional effects easier (like letting the board "explode" or something like that).
jPCT is mostly object based, not triangle based. I'll add some addional stuff for handling objects on the triangle level better in the next release, but its main focus are still objects.
#12099
Support / Re: jPCT for an engineering type app?
April 19, 2004, 10:39:32 PM
Quote
1. I assume I can render the image inside a JPanel (or similar) to allow JButtons, etc next to the scene? Lightweight or Heavyweight?

As you've already mentioned, this is possible with the software renderer. jPCT will render into an Image, so whatever can be done with an Image can be done with the rendered output (getOutputBuffer() in FrameBuffer will help you here). You may try to use OpenGL instead of software and get the rendered output in the same way, but that's most likely very slow and you'll still have an OpenGL-window lying around on your desktop...so that sounds like a bad idea.

Quote
2. How do I render a simple 5-sided polygon with a hole somewhere where the polygon, sides and hole are selecteble? Maybe publishing of some of the sample primitives will answer this question?

You have to model the 5-sided polygon with the hole by using triangles. Either by finding an algorithm that can do it or by using some 3d editor. Picking the polygons is easy, picking the sides...no idea at the moment but should be achievable somehow. Picking the hole is currently impossible, because you can't pick "nothing". A workaround would be to build the hole out of transparent polygons and pick that object instead.

Quote
3. Since I probably need to draw selectable 3D Lines and Points, I imagine I can use the Sphere primitive for the points but what about the Lines? Maybe use a very thin Cylinder?

You can easily build some primitives for that yourself. A cylinder should work too, but may be polygonal overkill.

Quote
4. I will most likely have 3 simultaneous views on the same model. Does jPCT support multiple simultaneous cameras?

Yes, you can do that. Either by modifying the camera itself for each view or by creating yourself 3 cameras and replace the camera in World with the right one for each view. PrimordialSoup did that. You can see the results in this thread: http://www.jpct.net/forum/viewtopic.php?t=15

Hope this helps.
#12100
Support / picking to 3d coordinate
April 18, 2004, 10:11:04 PM
You can get the polygon number by throwing the result of pickPolygon into getPolygonNumber(int[]). What you won't get ATM is the intersection point. Do you really need this information?
#12101
News / LWJGL 0.9 is out!
April 17, 2004, 12:40:09 PM
You can get it here: http://www.lwjgl.org

The current jPCT release (0.99) won't work with it, but the next one will.
#12102
Support / A few questions...
April 08, 2004, 12:00:44 AM
You can blit bitmaps over the rendered image using the blit()-methods in FrameBuffer. That's what the fps-demo does...When using the software renderer only, it's also possible to use AWT/Swing in combination with the rendered image but in respect to (possible) OpenGL support, i won't advise you to do so. If you use the blit()-methods in FrameBuffer, make sure to use the one that operates on Textures instead of int[]. It's usually much faster.
It's possible to "pick" an object with the mouse. Just add a MouseListener to your Component (our use the LWJGL was of doing it...it all depends if you decide to use OpenGL or not) and have a look at Interact2D. It offers methods for picking objects with the mouse.
Hope this helps.
#12103
Support / 3D points/lines and polygon normals
April 05, 2004, 05:54:54 PM
Quote from: "Musurca"Some sort of "TriangleController" would definitely be a welcome addition.
Yes, it would. I'll try to add this feature if i find the time. Anyway, here's the (premature) source of my "Car"-class. It contains the basic math i'm using to place the car on the terrain. It's not documented and still unfinished but maybe it helps somehow: http://www.jpct.net/stuff/Car.java
#12104
Support / 3D points/lines and polygon normals
April 04, 2004, 05:35:44 PM
No, i never had a look at the Spacecrafter API. If jPCT is similar to it, it's a just a coincidence. I tried to get a copy of the Spacecrafter API to have a look, but it's obviously not available anymore.

To your questions: Currently, there's no option to plot simple points. What is possible, is to define an object as billboarded and use simple, single triangle objects as particles (transparent and textured). However, i'm not sure how fast this would be but it think it should be fine. It's much more powerful than simple points too. Maybe you can implement your particles that way and let me know if it's ok or too slow.

Abusing the VertexController in the way you suggested won't work IMO, because it can only gives you the vertex normals and not the face normals. There's a another thread here somewhere, where i mentioned the possibility of a TriangleController to access face normals and some other properties of a polygon but i'm not sure if i really should do that.
I've just implemented the effect you want to achieve in a new example (will be included in the next release (i hope)...have a look at the news-section for a screenshot of it). In this example, i'm using calcMinDistance on all four wheels of my "car" and calculate the rotation angles using these values (Math.atan() is your friend here). When using octrees for your terrain, this should be very fast. At least i wasn't able to notice a slowdown caused by this method. This will also handle some cases better where the method using the face normals will most likely fail, so i think it's the better approach.

Hope this helps. If it doesn't, please let me know and i'll think about this topic again.
#12105
News / Working on new example
April 02, 2004, 12:30:14 AM
I'm currently working on a new example that shows how to make a vehicle follow a surface (=terrain) with jPCT. Here's a preview of how the current version looks like (the thingy in the middle is the vehicle... :wink: ).