|
Hello Friends
I am creating a viewer using java3d and previously i was using ambient light and two directional lights.But I want to use now spot lights.Now ,after using spot lights,I commented directional lights then the object is coming black but if object has some texture on some part then texture is showing but other part of object is black.
And If i use both direction light and spot light then object is coming right bur no effects of spot light.
Give me some Ideas how to use spot lights ? Do we need to use with directional or some other combination.
Thanks In Advance.
Yogesh Sikri
|
|
|
|
|
This article explains about Lights[^]
|
|
|
|
|
I read the link that u refer.Now the problem is how can I calculate the direction of spotLight As I came to know tht spotlight has one method for setting direction and it takes one parameter vector3f.
Now what I am having is :
I am having object values in vector3f() that i calculated using getBounds() of Object( m I right?).
I am having the distance between light and object also.
Now,how I can calculate the vector for light?
Do u have any Ideas??
Thanks & Regards
Yogesh Sikri
|
|
|
|
|
|
I already seen this link but i didnt get it.
Do u have any other Ideas??
Thanks for your answer.
Regards
Yogesh
|
|
|
|
|
actually the answer is in the code at the bottom of the page.
|
|
|
|
|
My project code which is in executable form MS-DOS BATCH File, is not execute.It just blinks.I can't execute it.what to do? My friend said, to make some changes in properties.But i d'nt know how to do it.Please help me...
|
|
|
|
|
ammu23 wrote: My project code which is in executable form MS-DOS BATCH File
So which is it, executable or batch file?
ammu23 wrote: My friend said, to make some changes in properties
Whose properties, Windows, your app, the bank?
Try and be a bit more specific about your problem:
- is this a Java program?
- what part of the source code fails, i.e. have you run it in the debugger?
MVP 2010 - are they mad?
|
|
|
|
|
I cant execute my java program which is in MS Dos Batch File format.It just blinks when i click on it.What should i do to execute it.
|
|
|
|
|
ammu23 wrote: I cant execute my java program which is in MS Dos Batch File format.It just blinks when i click on it.What should i do to execute it.
Well you have just repeated the question that I asked you to clarify, because it makes no sense. How can a Java program be "in MS Dos Batch File format"? Either you have a Java program which fails for some reason, or you have an MSDos Batch File which does something similar. Try to explain exactly how you created this program - if it is Java then do you have the source code, and if so can you run it through your debugger?
MVP 2010 - are they mad?
|
|
|
|
|
Try calling the batch file from a command line rather than clicking on it to run it. That way, if you are getting any error messages being displayed when the batch file execution fails you will get a chance to see them.
Possible problems range from errors in the Java code through to not having the java exe in the path. There are too many possible errors to know what to advise until you find more information about why it's failing.
|
|
|
|
|
I want to return an XML document via HTTP. Here is the code:
package gmit;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class XMLServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContentType("text/xml");
File file = new File("../webapps/xml/WEB-INF/etc/flights.xml");
FileInputStream in = new FileInputStream(file);
PrintWriter out = response.getWriter();
int i;
while ((i = in.read()) != -1)
out.write(i);
in.close();
}
How do I execute this code? The goGet() method takes two parameters but I don't know what the parameters are.
|
|
|
|
|
numbskull20 wrote: The doGet() method takes two parameters but I don't know what the parameters are.
Is this not your code?
MVP 2010 - are they mad?
|
|
|
|
|
No, I got it from a book. Murach's Java Servlets and JSP.
|
|
|
|
|
numbskull20 wrote: No, I got it from a book. Murach's Java Servlets and JSP.
Maybe you need to spend more time reading the book?
MVP 2010 - are they mad?
|
|
|
|
|
|
numbskull20 wrote: Grest help. Thanks.
I'm not sure whether your response was sarcasm or not but just to clarify my position, which I may not have made clear. Your code (taken from a book that I have not read) contains the following lines
public class XMLServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContentType("text/xml");
You then state that you do not know what the parameters to the doGet() function should be. If the book does not explain it how can anyone here?
MVP 2010 - are they mad?
|
|
|
|
|
Plus this is a web question so of it goes to web development forum.
|
|
|
|
|
I think that's arguable, after all it is Java source.
MVP 2010 - are they mad?
|
|
|
|
|
Hello Friends
I have to read a file in binary mode as we do in c++ by using ifStream.
Is there any way in java to do that?
Thanks In Advance.
Yogesh
|
|
|
|
|
You should really make more use of the tutorials[^] for basic questions. Java, like most languages, supports I/O from basic byte/byte-stream right through to Object serialization.
MVP 2010 - are they mad?
|
|
|
|
|
Hello Friends
I created a project in java tht Encrypts and derypts a file.But first of all I want to know Is that Possible If i use the same code in C++ way to encrypt and decrypt the same file thru java Code.
Another Question is Can I convert Directly my java code to C++ file?
Thanks & Regards
Yogesh Sikri
|
|
|
|
|
1. Given the same key, file, and algorithm then yes.
2. Depends on the implementation of the Java code.
|
|
|
|
|
Encryption in C++ is not quite as simple as in Java but it can be done. You may find articles about it either here or via Google. See also my response here[^].
MVP 2010 - are they mad?
|
|
|
|
|
In college, I was given an assignment, to use these methods to sort a list alphabetically from the args array from a cmd prompt input from the user.
I can take in and print out the list, sorted, however, when I sort it, it doesn't print correctly, eg 1 2 3 4 5 might print as 1 2 4 3 5.
My source code can be seen here:
[MySortProgram Source Code]
|
|
|
|