Solved

VRML Questions : Urgent ! Interior and Exterior Object

Posted on 2003-10-22
16
392 Views
Last Modified: 2013-12-04
Greeting to all experts here :

I had a questions(maybe simple to you but not to me) to ask about Virtual Reality Modeling Language (VRML). I totally new to this language. Basically i just want to make a object as display at :
http://www.nissan.ca/en/vehicles/sentra_ser/exterior.html#360ExteriorView
-Click PLAY VIDEO.
[Note : You need to download pulgin in - Quick Time to view the objects]

I dont know what requirement i need to use in order to solve my problems. I just want to make a simple VRML objects(involve interior and exterior design) for a car. To make it clearly, i just want to solve following problems :

1.know all the basic step to make/run a vrml object.
2.make an object (involved interior and exterior) for a car as shown at URL above into a web site.

If you know the solutions, simply show me the guidelines. I need someone who really can put me into the right track to solve my problems. This is urgent to me, i need to get it work.

Thanks a millions.
I appreciate for ANY helps. Hope you can give me some guidelines.
I know this questions is pretty dizzy (maybe for me), i will give a huge BONUS points to anyone who can solve the questions completely.

Regards
x_com
0
Comment
Question by:David H.H.Lee
  • 8
  • 8
16 Comments
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 500 total points
ID: 9597077
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9597129
Thanks for quick response, sunnycoder(good record too).
Which links to solve my problems? I out of time to solve this problems(create interior and exterior object for car). Hope you can put me in the right track. Thanks a millions.

For the basic info to make/run a vrml,
can you state it out here what tools + all required stuff that i need to use?I cant read it from the links Benetz.

Thanks. Sorry for my dizzy requirement. This is new to me, hope you can understand the situations here. Thanks.

Regards
x_com
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 500 total points
ID: 9597342
from the links it seems that to write a program, all you need is a text editor ...
what platform are you working on

I would suggest that you take some time to read the links carefully
http://www.eecs.tulane.edu/www/Benetz/mainpage.html and
http://tecfa.unige.ch/guides/vrml/vrmlman/vrmlman.html
have everything that you are asking
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9597363
Thanks again for your helps. I will take some times to read for it. But, could be somethings can be more express to solve my problems?I only need to get it work for create a simple interior and exterior for a car. I need to get it work in a web site. Possible same tools as recommended here?
What i need is just a text editor? What tools do i need to use it run vrml object? It's that Quick time or any else? Sorry for asking stupid questions, but i'm really no idea for it. Thanks a millions.
I hope you can guide me more clearly. I'll award 'A' and bonus points if this problems solve. There still have some though questions need to solve. I'm lack of time to do this.

Regards
x_com
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 500 total points
ID: 9597407
from: http://tecfa.unige.ch/guides/vrml/vrmlman/node5.html
There are 3 (major) ways for producing VRML:


1.
Code VRML by hand. If you like to hand code VRML (which is a good choice for learning how to build truly interactive worlds), consider getting a VRML assisting editor like emacs.

2.
Use a VRML supporting Modeler. There are basically two types of tools you need:
(a)
A object creation tool

(b)
A space (or ``walk thru'') creation tool such as Cosmos' (ex-Paragraph's) Home Space Builder (the non-profit versions are cheap) or Virtus' Walkthrough Pro.

See e.g. the Tools section in our VRML Pointers.

3.
Use a Filter to transform other 3D Formats into VRML.


http://tecfa.unige.ch/guides/vrml/vrmlman/node6.html
The structure of a WRL File:
VRML (*.wrl) files have 3 basic elements:

1.
A header which tells the browser that the file is VRML and which version also. A header line is mandatory.

2.
Comments are preceded by a #.

3.
Nodes: Most everything else are nodes. Nodes generally contain:
(a)
The type of node (required). Nodes always are in Capital letters.
(b)
A set of curly braces {.....} (required)
(c)
A number of fields, all or some of which are optional. Note that there is no mandatory ordering of fields.
(d)
Fields with that can have multiple values require braces [ ...]. Fields always start with lowerCase letters.
Here is a typical VRML file with a single node (don't worry if you don't understand it):

# VRML V2.0 utf8
# A sample file with a single stupid node

Transform {
   translation 0 2 0
   children [
      Shape {
         geometry Sphere {}
      }
     ]
 }

0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 500 total points
ID: 9597424
4. Mixing HTML with VRML
In this chapter you will learn a few more static VRML tricks. Alternatively you can start learning some interactive VRML and directly go to chapter 5 on page
4.1 Introduction
HTML-VRML links:
Embeding a VRML browser in a HTML Page:
VRML-HTML links:
JAVA, Javascript, VRML, HTML links:
4.2 Mixing HTML and VRML Frames
4.2.1 VRML scenes library
4.2.2 VRML to HTML in a frame
4.3 VRML code generation
4.3.1 VRML Code Generation with Javascript
4.4 Adding and Removing Kids with Javascript
http://tecfa.unige.ch/guides/vrml/vrmlman/node15.html
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9597445
I' read some of the article provided by you.
It's that anyways i can integrate with javascript? I want to make a object can rotate 360 degree as shown at
http://www.nissan.ca/en/vehicles/sentra_ser/exterior.html#360ExteriorView
-Click PLAY VIDEO.
[Note : You need to download pulgin in - Quick Time to view the objects]
Or

I didint need javascript and just follow your guidelines?
Thanks again for your great helps.
i really want to get it work as soon as possible. I'm lack of time.
Thanks a millions and sorry for my stupid questions again. Your effort to me will reward a great grade later. I promise!

Regards
x_com
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 9597456
Generating a VRML scene with Javascript is rather easy once you know how to deal with Netscape Frames using Javascript. [You also need a browser that works, some older browsers will not allow to it].

Generating VRML can be useful in various applications, e.g. you can write a VRML generator for your students or show mathematical functions (or other data) in 3D. The next example has been very strongly inspired from Yasuyuki Suzuki's Object Creation example.



Example 4.3.1   VRML code generation with Javascript  

Contents: Contains 2 frames. A html/javascript frame allows to create simple objects
HTML: generate-js-1-frame.html
Frame Source: generate-js-1-frame.text
HTML/JS Source: generate-js-1.text

Look at the full example before you move on please ! Below we will discuss a slightly simplified version. Anyhow, in order to understand this example you rather must learn more about Javascript than anything about VRML. (See Netscape's OnLine documentation for developpers. At Tecfa we have a copy of the JavaScript Guide).

Let's have a quick look at the frameset in the file generate-js-1-frame.html (if you don't understand this, please read section 4.2 on page ).

<FRAMESET COLS="*, 70%">
<FRAME SRC="generate-js-1.html" NAME="menu_frame"
       BORDER="0">
<FRAME SRC="javascript:top.vrml();" NAME="vrml_frame"
       NORESIZE SCROLLING="no">
</FRAMESET>

Note that we also generate dynamically an inital object in the frame by directly calling javascript:top.vrml(). We could have left this page blank or inserted some canned VRML *.wrl page. Just remember that the frame to the left is called menu_frame and the frame to the right vrml_frame.
The user enters size and color information in the left (HTML/Javascript) frame and then can click on ``Create Box''. This will render the object in the VRML frame to the right.

This is a simple HTML Form that will collect information from the user. Note the following things:

1.
The ``form'' tag has just a name field (no method field needed)

2.
The input ``button'' will trigger an onClick event when pressed that will launch the ``makeBox'' script. This script will then poll the form for values the user entered (see below).

<FORM NAME="cont">
<STRONG>Example Objects:</STRONG><p>
<STRONG>Custom Box:</STRONG><p>
 Width : <INPUT TYPE="text" NAME="w" VALUE="1" SIZE="5"><br>
 Height : <INPUT TYPE="text" NAME="h" VALUE="1" SIZE="5"><br>
 Depth : <INPUT TYPE="text" NAME="d" VALUE="1" SIZE="5"><p>
 Colors (be sure to enter values between 0 and 1!<br>
 Red  : <INPUT TYPE="text" NAME="red" VALUE="1" SIZE="5"><br>
 Green : <INPUT TYPE="text" NAME="green" VALUE="0.2" SIZE="5"><br>
 Blue  : <INPUT TYPE="text" NAME="blue" VALUE="0" SIZE="5"><p>

<INPUT TYPE="button" NAME="make" VALUE="Create Box" onClick="makeBOX();"><P>
<HR>
</FORM>

Here are the most important elements of the (simplified) source code. The function makeBOX will draw a box of a given size in given colors. It will access the values entered in the form below and write lines to the VRML frame.

In this example (like in the original) we poll the values the user entered from the form, e.g.:

     w = top.menu_frame.document.cont.w.value;

will assign the value for the width of the box to a temporary variable ``w''. There are several ways of doing this as you can note. Also note that polling the form is one way of doing it. Alternatively we could have passed the values to this function within the INPUT tag of the form. Finally be aware that we do not any value checking. It's up to the user to enter good values.

var MIMEType = 'x-world/x-vrml';

function makeBOX() {
     var w, h, d, red, green, blue;
// Note: all these ways of accessing values work
     w = top.menu_frame.document.cont.w.value;
     h = top.menu_frame.document.forms[0].h.value;
     d = document.forms[0].d.value;
     r = document.forms[0].red.value;
     g = document.forms[0].green.value;
     b = document.forms[0].blue.value;

     with (top.vrml_frame.document) {
        open(MIMEType);
        writeln('#VRML V2.0 utf8');
        writeln('Shape \{');
        writeln('  appearance Appearance \{');
        writeln('        material Material \{ ');
        writeln('           emissiveColor ' + r + ' ' + g + ' ' + b);
        writeln('                      \} \}');
        writeln('  geometry Box \{');
        writeln('     size ' + w + ' ' + h + ' ' + d)
        writeln('\} \}');
        close();
     }
}

The only other thing you need to know is how to write to the VRML frame:

1.
We first get some handling on the VRML frame's document window object. The with statement makes referring to objects properties and methods simpler (you don't have to type the full path each time). In the following expression top refers to the ``top'' node in the Javascript hierarchy (?), vrml_frame is the name we gave to the frame where the plugin will appear and document refers to it's contents.
      with (top.vrml_frame.document) {

2.
Next we ``open'' output to the vrml frame with 'x-world/x-vrml'.
      var MIMEType = 'x-world/x-vrml';
      .....
      open(MIMEType);

We defined the variable MIMEType here since we do it more than once.

3.
Next you simply write out the VRML code (including a valid VRML header first).

4.
Then you close the output to the frame.
Note how we can simply ``string-add'' ``canned'' VRML instructions with variables in the code. Javascript is very convenient in this respect.

http://tecfa.unige.ch/guides/vrml/vrmlman/node18.html#SECTION00731000000000000000
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9597523
sunnycoder,
I know pretry much above Jscript. I will take some time to look around all the advice given here. I will post my questions here if i got anythings didnt get it work. Thanks for your helps.
if you get any sample for VRMl objects which can lead me to solve my questions based on this objects shown at :
http://www.nissan.ca/en/vehicles/sentra_ser/exterior.html#360ExteriorView
-Click PLAY VIDEO.
[Note : You need to download pulgin in - Quick Time to view the objects]
I do like to take a look here.

THANKS a millions!!

Regards
x_com
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9612368
sunnycoder,
I'm still cant get it work. Maybe i missing somethings/steps there?

Regards
x_com
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9612583
what is the problem encountered ?
try with the simplest example first and then graduate to more complex stuff
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9659268
sunnycoder ,
sorry for late response because I need some time to read all your provided links/helps before i ask silly questions. Now i think i have some idea about VRML. Thanks.

ok,it seem work fine for a simple object. Do you have any more complicated source which can be use in a web site, just like what i need ?It's seem i still can't build a complete object that can be use inside a web site.

Thanks a thousand millions for your HELPS. Appreciate!

Hope can hear from you very soon...

Regards
x_com
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9669650
this time apologies from my side... i was away on a vacation

>Do you have any more complicated source which can be use in a web site, just like what i need
right now, no... just give google search a try with eact keywords for what you require and it will definitely throw up some useful links
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9676619
@sunnycoder ,
I know i cant search the info. based on Internet. But, i'm afraid i will get all those garbage references...Can you show me the right references?I appreciate your helps as well....Thanks..Thanks...Thanks..

Hope can hear good news from you.

Regards
x_com
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 500 total points
ID: 9676658
0
 
LVL 29

Author Comment

by:David H.H.Lee
ID: 9706421
sunnycoder ,
Thanks for your helps. Appreciate for your helps. THANKS!!!!
Sorry for my delay because i'm busy with my others task. Time to make it PAQ.

Take this BONUS points for your great services. THanks.
http://oldlook.experts-exchange.com/Programming/Q_20791726.html

Appreciate your helps!! Thanks....

Regards
x_com
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now