Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Grant Crofton

Ranch Hand
+ Follow
since Nov 08, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Grant Crofton

At the most simple level, you can make something look 3D-like with a couple of coloured lines. If you are using Windows (or anything else that does this), just check out the buttons - they are a flat grey colour with lighter lines on the top & left, and darker lines bottom & right. This works quite well for blocky graphics, which you are probably using.
Taking it to the next level, you can create graphics in a 3D modelling package and use them in your game. This is a bit more involved of course, but you can get some 3D apps free, create the graphics you want, and render them to a 2D image. You can even aminate it like it's 3D - I did this with a vertical scrolling shooter, which had a 3D ship rolling as you moved sideways. it was simply a case of rendering it from about 10 different angles each side, and animating it within the game according to how the ship was moving. it was in C though, so the code probably wouldn't be much use.
17 years ago
I'm using Java3D for my final year project (evaluating it for game development - basically making a 1st person game demo), and i am having a couple of difficulties.
I notice that there are not many Java3D questions on here, so my first question would be 1. Does anyone know of any more active forums related to J3D? I've been on the 'official' sites (Sun, j3D.org, etc), but there doesn't seem to be a right lot out there.
Here are a couple more: 2. Using the KeyNavigator behaviour, how do i find out what key was pressed? The Enumeration you get with processStimulus() doesn't seem to include that information. If I make my own, how do i set it up? The WakeupOnKeypressed 9or whatever it is called) condition only seems to work with KEY_PRESSED etc, not VK_SPACE.
How do you tile textures? I've tried loading them with an ImageComponent2D and just with a Texture, and neither way seems to offer a way of tiling the image texture (it can be scaled).
3. Collision behaviours - when I set up a WakeupOnCollisionentry behaviour, how do i stop some nodes affecting it, or alternatively find out what node it was that hit it? I currently have some spheres that I shoot to destroy using this method. however, if the spheres are touching anything to begin with, the behaviour fires imidiately. I have tried to find what node hit the target object using the Enumeration in processStimulus(), but when i try to getActionNode(), I get a NullPointerException! I don't know why that would be, as there must be a node to cause the colision.
if anyone can shed a little light on any of these, that would be great. I haven't got my code with me, so i hope those function names were right.
Thanks
17 years ago
Probably not. If you just want the snake game to look 3D (with a raised effect, like windows buttons) or even isometric (where the view is from a constant angle, like 45 degrees above), you are better of just creating 3D-looking graphics and making it as normal. A lot of games use graphics created in something like 3D Studio MAX, which are rendered into 2D and put into the game, which makes it look 3D but keeps things simple.
Java 3D can do a lot, but it takes a bit of learning, especially if you haven't done much 3D before. One you get into it it's fairly simple, but you have to learn all about scene graphs, transforms, behaviors etc before you can actually make anything useful. You can't just say cube(1,1,1) and get a cube on the screen, you need to set up a virtual universe, set up a view, etc..
If you want to make a full-on 3D snake, it would definately be worth looking into, but if you just want it to look good it's probably more hassle than it's worth.
17 years ago
if i understand what you're saying, you are trying to rotate the cube around a different axis than the centre - for example, around one of the corners.
I am just learning J3D now, so i can't recite the code for you, but i think you need to transform the cube and then rotate the transform.
So, say if the cube is at 0,0,0 and is sixe 2 all round, transforming it 1,0,0 will move it so that the side is now where the centre used to be - call this transform tmove. Instead of rotating t1, make another transform (say, tRot), which holds the first transform. Rotating tRot will rotate tMove, which will rotate the cube around its side.
Basically, use a seperate TransformGroup for each step (rotation & movement). You can do it in the same one, but having two keeps it simple.
17 years ago
I have a project that I'm not sure how to approach, so I thought you guys might have some ideas.
OK, here goes...
I have to plot some data from an MS Access (and in the future, SQL Server) DB on the Internet. The data is simple sales numbers or similar, it just wants showing in bar charts or something.
The trouble is, I don't know the best (/easiest) way to do this.
I'd thought I could just have an applet that connects with JDBC to the data source and plots accordingly, but on reading the docs it seems that the JDBC-ODBC bridge is unsuitable cos you have to configure ODBC on the client, have a signed applet, and not all browsers support it.
We could buy a proper JDBC driver, but they seem quite expensive and we'd need a new one when the DB moved from Access to SQL Server.
I could pass all the data as <PARAM>s to the applet, but the page would need reloading when you wanted to view different data (eg. zoom in or scroll through it). This is possible with JavaScript and ASP or similar but it might be a bit messy.
Another way I was thinking of was to have a Java prog run on the server, drawing the image for the web page to load according to parameters passed from an ASP page or something. I don't think it would be hard to launch an app from an ASP page, but I'm not sure if the web page could be made to wait for the image to be drawn. Perhaps some JavaScript could do this. As the app is on the server, there wouldn't be a problem reding from the DB with JDBC-ODBC. Also the image would have to be saved as a GIF (or JPEG) - is this possible?
The last option would be to buy something that did this already, as an applet or ActiveX control. Anyone know of anything that would do the job?
OK, I think that's about it. Any thoughts?
19 years ago
You must get asked this all the time, but I searched and couldn't find what I'm looking for.
I'm trying to set up a JDBC-ODBC link for use with Access 2000, but on the line
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
I get a ClassNotFoundException.
I can compile everything OK. I don't have a CLASSPATH set, is this the problem? I'm using JDK1.3 and Win2000, the code is in an applet.
When I can get this working, I intend to have the applet accessing the DB on our web server (over the Internet).
However, I've been reading the Sun docs about setting this up, and at the end it says something about JDBC_ODBC being unsuitable for the Internet as all clients have to have various things installed on them, so should I not be using this?
(http://java.sun.com/docs/books/tutorial/jdbc/basics/applet.html, last paragraph). If I shouldn't, how do I set up an MS Access driver?
Thanks.
No, if the method wants an Object, the method'll have an Object.
You could shorten it slightly with someMethod( Boolean.class, new Boolean( bP ) );
What's wrong with doing it the first way?
19 years ago
Yeah, I get the same problem with it hanging when I use beep(), but printing 7 works OK.
19 years ago
In what context?
19 years ago
++X
If you consider that the operator is '++' then the prefix version does have right associativity, as it evaluates the variable then increments it (applies the operator).
I'm not even sure if you could call it associativity, as there is only one side to evaluate (didn't really concentrate in maths)- so how do you show this in an expression? Perhaps the author's just trying to explain the difference between x++ and ++x.
I guess any expression shows it
x=1;
y=3*++x; // shows x is incremented before being multiplied
19 years ago
++X
If you consider that the operator is '++' then the prefix version does have right associativity, as it evaluates the variable then increments it (applies the operator).
I'm not even sure if you could call it associativity, as there is only one side to evaluate (didn't really concentrate in maths)- so how do you show this in an expression? Perhaps the author's just trying to explain the difference between x++ and ++x.
I guess any expression shows it
x=1;
y=3*++x; // shows x is incremented before being multiplied
19 years ago
Native methods are compiled ones, (usually) written in another language like C++. They're called native because they're in machine code that can only be understood by one platform - they're native to it.
Don't have any examples, though.
19 years ago
I don't know the inner workings, but Punnu's right - the ints get added together before being converted to a string.
If you had s.o.p( 7 + " " + 3 + " " + 0 );, you would be right (I didn't bother putting them in an array, it makes no difference), but having (7 + 3 + " " + 0 ) is the same as having ( 10 + " " + 0 ) - the ints are added together first.
19 years ago
I've just been looking for some statistics, but I can't seem to find anything reliable (there are a few things on sun's site).
As far as I was aware, Java is fast becoming if not already the most popular programming language about. But then I don't really have anything to ck that up with.
Here are some links:
This is about the European job market, but it says go Java: http://www.techweb.com/wire/story/TWB20001005S0004
This is from an article about job interviews (or something)
"Desperate companies don't care if the candidate is a job hopper. They're not doing background checks...If they see C++ or Java on the resume, you're in, regardless of your manners." (from http://news.cnet.com/news/0-1007-200-2212724.html )
This is about the US job market, and suggests that there aren't that many openening in India at the moment: http://www.sunservermagazine.com/billday/bday0200.htm
if ths page worked, it should answer your question (supposed to show job ststs, but didn't work when I looked): http://jobstats.jobnet.com.au/jobtools/jsjobstats.displaycategory?in_catid=5&in_type=100
This says Java is a good career path: http://www.sunworld.com/swol-02-1996/swol-02-career.html
And this page says some good things about it, although I think it's a couple of years old: http://java.sun.com/people/jag/Presentations/JapanDevCon/text2.htm
IDC reckon Java is the most in-demand skill in Dev, although the number of developers is going down: http://www.idc.com:8080/software/press/PR/sw030200PR.stm
19 years ago
I've just been looking for some statistics, but I can't seem to find anything reliable (there are a few things on sun's site).
As far as I was aware, Java is fast becoming if not already the most popular programming language about. But then I don't really have anything to ck that up with.
Here are some links:
This is about the European job market, but it says go Java: http://www.techweb.com/wire/story/TWB20001005S0004
This is from an article about job interviews (or something)
"Desperate companies don't care if the candidate is a job hopper. They're not doing background checks...If they see C++ or Java on the resume, you're in, regardless of your manners." (from http://news.cnet.com/news/0-1007-200-2212724.html )
This is about the US job market, and suggests that there aren't that many openening in India at the moment: http://www.sunservermagazine.com/billday/bday0200.htm
if ths page worked, it should answer your question (supposed to show job ststs, but didn't work when I looked): http://jobstats.jobnet.com.au/jobtools/jsjobstats.displaycategory?in_catid=5&in_type=100
This says Java is a good career path: http://www.sunworld.com/swol-02-1996/swol-02-career.html
And this page says some good things about it, although I think it's a couple of years old: http://java.sun.com/people/jag/Presentations/JapanDevCon/text2.htm
IDC reckon Java is the most in-demand skill in Dev, although the number of developers is going down: http://www.idc.com:8080/software/press/PR/sw030200PR.stm
19 years ago